Forums:
Hi I found this Function in Forum, Is it possible to do it in assembly level. I basically want to collect all the visible bodies from the current displayed part regardless assembly or part. I can use this following one for part. Is there anyway to do it in assembly?
PS: I want to measure all bodies volume, and create bound box around it as I earlier requested in bound box Topic
http://nxjournaling.com/content/creating-bounding-box-arround-solid
For part level I am able to create boxes for individual bodies and unite them then get the overall bounding dimension. It is working well.
Function AskAllBodies(ByVal thePart As Part)As Body()Dim theBodies AsNew System.Collections.ArrayList() Dim aBodyTag As Tag = Tag.NullDo ufs.Obj.CycleObjsInPart(thePart.Tag, _ UFConstants.UF_solid_type, aBodyTag)If aBodyTag = Tag.NullThenExitDoEndIf Dim theType AsInteger, theSubtype AsInteger ufs.Obj.AskTypeAndSubtype(aBodyTag, theType, theSubtype)If theSubtype = UFConstants.UF_solid_body_subtypeThen theBodies.Add(theSession.GetObjectManager.GetTaggedObject(aBodyTag))EndIfLoopWhileTrue ReturnDirectCast(theBodies.ToArray(GetType(Body)), Body())EndFunction