• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

rename solid bodies in multibody based on size

Giangio95

Guest
Good morning to all,
I looked for a similar topic on the forum but I didn't find it.
I designed a folded sheet metal multibody, this is a cross-section of lifts formed by multiple components. logically as you can understand lifts are not equal suits, and the lengths of these beams change.
I created a library in the content center where they select the cross and give a measure in length. I would need all the bodies inside the multibody to change name according to the length I gave to the body.
e.g. I insert cross-section 1500, so I would like to find the various bodies renamed in : 001_1500; 002_1500; 003_1500.
whereas if I insert 2000 I will find the components referred to in 001_2000; 002_2000; 003_2000.
Is that possible? I think it's a job to do through ilogic.
I continue to study on it, if I find a solution I write down below.
Thank you in advance
 
similar discussion that refers to another
 
Hello, catafract,
I saw the discussion.
I press that I am ignorant with ilogics and I am taking it in my hand now for the first time.
according to the written rule, the name of the final body will be composed by the name of the multibody, the writing that we find between the quotes selected in the attached image, and in the end a sequential number starting from 1. I would like that instead of writing the cross parameter, the rule would write me the length of that parameter selected.

below the written rule:

syntaxeditor code snippetdim sb as surfacebody
dim doc as partdocument = thisdoc.document
dim sbs as surfacebodies = doc.componentdefinition.surfacebodies
dim sbname as string = thisdoc.filename(false)
dim suffix as integer = 1

' loop through all solid bodies, renaming them
for each sb in sbs
sb.name = sbname + "ltraversa" & cstr(suffix).padleft _
(len(cstr(doc.componentdefinition.surfacebodies.count)), 0)
suffix + 1
next


Thank you.


1622013813021.webp
 
Thank you very much!
very kind and very helpful!
Now I try to work on it.
thanks and good day
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top