Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Update Physical Properties from Drawing

7 REPLIES 7
Reply
Message 1 of 8
Anonymous
1901 Views, 7 Replies

Update Physical Properties from Drawing

Does anyone know how I can update the physical properties for a part or assembly, from a drawing? My drawing template is showing the total weight for the current part/assembly, and I would love if Inventor could update this using iLogic, so I don't get the "N/A" value all the time. 

7 REPLIES 7
Message 2 of 8
matt_jlt
in reply to: Anonymous

Hi, I had the same problem, i created an external ilogic rule that accesses the part/assembly from the idw file and creates or updates a custom property called imass inside the part/assembly and set it to run/update each time an IDW is saved.

 

I then used a link to this parameter instead of the actual mass.

 

You could also change the setting under "Application Options" under the "General Tab" There is a panel called "Physical Properties" and a check box for "Update Physical Properties On Save", this might solve your problem. I didn't do this because i didnt want to have it update the mass properties everytime i save something especially for large assemblies.

 

Regards, Matt.

 

iMass i-Logic Code Below:

 

' Check if there are any views on the sheet
    If ActiveSheet.Sheet.DrawingViews.Count = 0 Then
        Exit Sub
    End If

' Define Referenced Document
    Dim oDoc As Document = ThisDrawing.ModelDocument

' Access Document Mass Properties
    Dim oMassStr As String = Round(oDoc.ComponentDefinition.MassProperties.Mass,0)

' Create / Modify iMass Custom Property
    Try
        Call oDoc.PropertySets("Inventor User Defined Properties").Add(oMassStr, "iMass")
    Catch ex As Exception
    oDoc.PropertySets("Inventor User Defined Properties").Item("iMass").Value = oMassStr
   
    Finally
    ' Save Assembly Document
        oDoc.Save

    ' Update Drawing to reflect changes
        InventorVb.DocumentUpdate()
    End Try

Message 3 of 8
Anonymous
in reply to: matt_jlt

Thank you very much for the reply. The only problem is that we've got thousands of parts and assemblies and they doesn't have that custom parameter. Maybe I just have to use the Application setting you mention. 

Message 4 of 8
matt_jlt
in reply to: Anonymous

The iLogic Code that I gave you adds the parameter into the assembly/part file if it doesn't exist automatically.

Message 5 of 8
Anonymous
in reply to: matt_jlt

I used the code you gave me and removed the lines related to the iMass parameter. And it actually works! Now the mass is updating every time I save and before printing to PDF. Thank you!

 

SubMainUpdateMass()
IfActiveSheet.Sheet.DrawingViews.Count=0Then
Exit Sub
EndIf

DimoDocAsDocument=ThisDrawing.ModelDocument
DimoMassStrAsString=Round(oDoc.ComponentDefinition.MassProperties.Mass,0)
InventorVb.DocumentUpdate()
End Sub
Message 6 of 8
matt_jlt
in reply to: Anonymous

I'm not exactly sure why that works, maybe referencing the mass properties forces it to update the mass?Any way, glad it works for you.

Regards, Matt.

 

Don't forget to mark the post as solved if your happy with the answer.

Message 7 of 8
DeerSpotter
in reply to: Anonymous

 InventorVb.DocumentUpdate(iProperties.Mass)

 so simple

Image and video hosting by TinyPic
..........................................................................................................................
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
..........................................................................................................................


See My LinkedIn Profile
Message 8 of 8
Anonymous
in reply to: Anonymous


@Anonymous wrote:

Does anyone know how I can update the physical properties for a part or assembly, from a drawing? My drawing template is showing the total weight for the current part/assembly, and I would love if Inventor could update this using iLogic, so I don't get the "N/A" value all the time. 


It can be done at least in Inventor 2014.

When you create a new part and extrude it for an example; click on Manage toolbar at top of Inventor window.

One of icons is Fx. Click on it and then you can update dimensions of that part.

Also one can add material for that part whereby mass properties will be updated based upon density of the material chosen for this part

Inertia and other related items are based upon the structural shape of your part therefore one may have to calculate  said properties.

If one creates assemblies from created parts current assemblies should update based upon information one provides for an individual part.

Hope it helps.

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report