Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

SEPARATE PART NUMBER FOR MULTIBODY SOLIDS IN .IPT FILE

Anonymous

SEPARATE PART NUMBER FOR MULTIBODY SOLIDS IN .IPT FILE

Anonymous
Not applicable

Hello All,

 

One of our customer asked, is there any way to assign different part numbers to various multibody solids in a single .ipt file?

I suggested customer to push multibody solids to assembly environment, but customer do not want this option, he need to assign part numbers in .ipt file itself?

For me, this query sounds strange and most likely not possible.

If it is there anyway to assign part numbers to multibody solids using i-Logic or through API codes, i am very much eager to look forward on same.

Please let me know.

 

0 Likes
Reply
460 Views
3 Replies
Replies (3)

MechMachineMan
Advisor
Advisor

You could probably assign them in the multibody environment using assets, through iLogic. However, the only way to fetch them would be using more iLogic.

 

In this case, it's likely just easier and cheaper for them to streamline the process so they can use inventor as it is intended.


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes

Jesper_S
Collaborator
Collaborator

Hi.

 

Do your customer want to create a drawing later using the Multibody Solid part?

Assign partnumber to the solidbody name? 


//Jesper

Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
0 Likes

mgigliotti
Participant
Participant

You could use ilogic routine to create a text parameter for each body, with a linking naming convention (i.e NameOfBody = PartNumber and NameOfBodyParameter = NameOfBody.  We do something similar when working in the MB Parts for weldments, but we use this to push meta data out to the individual parts when we make components, and link geometry parameters like plate thickness from the MB to its derived component and so forth to Stock names and part numbers.

 

The problem of course is those parameters are not visible to the BOM, unless you actually go and eventually make the parts prior to doing a drawing.  So you need further scripting to drill into the part and get the faux part numbers and document them in some way.

 

So I guess the short answer is totally doable, but only really useful, if you ultimately get the data back out again by either more scripting or doing the thing that others seem to be suggesting, which is use make components command to push all the bodies to an assembly.

 

Hope this is of some help.

Below is pasted code, (somewhat in progress) for assigning part numbers and descriptions to bodies.  The next step, (still working on) is sending that data to the eventually created parts.  It is, I will warn you, shamelessly cribbed from many other sources and cobbled together for my purposes. It is also under commented at the moment and not yet finished.  When it is better shaped up I will repost if anyone finds it remotely useful.

 

M

 

'CODE BEGINS

Dim oDoc as Document
Dim oPartDoc as PartDocument
Dim oPartCompDef as PartComponentDefinition
Dim oParams as Parameters
Dim oUserParams As UserParameters
Dim oBody as SurfaceBody
Dim strBName as String
Dim strSubID as String
Dim strSubSubID as String
Dim strPartID as String
Dim oSet as HighlightSet
Dim oSelected as ObjectCollection

 

'Dim oParameter as Parameters

oDoc = ThisDoc.Document
oRedColor = oDoc.Assets("Red")
oPlateColor = oDoc.Assets("Plate")
'oUserParams=ThisApplication.ActiveDocument.ComponentDefinition.Parameters.UserParameters
'check document is a part
'if not an assembly go to end of rule
If oDoc.DocumentType = kPartDocumentObject Then
 oPartDoc = oDoc
 oPartCompDef = oPartDoc.ComponentDefinition
 oParams=oPartCompDef.Parameters
 oSet = oPartDoc.CreateHighlightSet
 oUserParams=oParams.UserParameters
 strSubID = iProperties.Value("Custom", "SubID")
 strSubSubID = iProperties.Value("Custom", "SubSubID") 
 strPartID = iProperties.Value("Custom", "PartID")
 strID = strSubID & "-" & strSubSubID & "-" & strPartID
 'msgBox (strID)
 'oSet = Nothing
 For Each oBody In oPartDoc.ComponentDefinition.SurfaceBodies
  'oSet = Nothing
  'oSet.AddItem (oBody)
  oBody.Appearance = oRedColor
  strBName = oBody.Name
  intNameL = Len(strBName)
  strBPart = Right(strBName,intNameL-1)
  strPartName = strSubID & "-" & strSubSubID & "-" & strBPart
  'msgBox (strPartName)
  strPName = strBName & "Description"
  
  Try
   paramcheck = oUserParams.Item (strPName)
   strCurrent = paramcheck.Value
   strDescription = InputBox ("Change " & strBName & " Description?" & VbCrLf & "CURRENTLY:" & VbCrLf & strCurrent & VbCrLf & "Leave blank to keep current.")
   If Not strDescription = "" Then
    paramcheck.Value = strDescription
   End if
   'msgBox (strCurrent)
  Catch
   strDescription = InputBox (" Enter " & strBName & " Description")
   strDescription = iProperties.Value("Project","Description") & ", " & strDescription   
   oParameter= oUserParams.AddByValue(strPName, strDescription,UnitsTypeEnum.kTextUnits)
  End Try
  oBody.Appearance = oPlateColor
 Next

'CODE ENDS

 

 

0 Likes