I'm trying to set the iProperties value Mass. I'm using a placeholder block to cut down on the graphics load, but I still want the part to reflect the correct weight load and weight distribution. I'm starting with the flollowing code:
child block as :block, quantity = 4
iProperties = {{"Mass", 8}}
end child
the value shows up here
but not here
how do I pass the value through?
Thanks,
Andrew
Not sure why this isn't working for mass properties. The same technique seems to for custom properties, e.g.
iProperties = {{"test", 200.0}}
Then a custom property is added:
Hi,
iProperties are stored in the Inventor document/file (IPT, in your case). If you switch to the ClientGraphics implementation of the block, there will not be a document behind it.
You may consider adding the Parameter/Rule to keep the value of the mass.
I'm not sure what you mean by "adding the Parameter/Rule to keep the value of the mass".
What are ClientGraphics?
Do you have an example of how I would go about doing this?
What do you mean by "keep the value of the mass"?
Andrew
Create new Design that extends block:
Design BlockWithMass : Block Rule Density As Number = 10.0 Rule Mass As Number = Me.width*Me.height*Me.length*Density
Parameter Rule Mass1 As Number = 0.0 End Design
Create the child list in your assembly:
Child block As :BlockWithMass , Quantity = 5
width = child.index
height = child.index
length = child.index
origin = Point( child.index*2, 0, 0)
Mass1 = 8.0
End Child
Please note that Mass is a Rule (which is calculated from the block size), and Mass1 is a Parameter, that can be specified during creation of the BlockWithMass
Mass of the block 3 will be determined as:
Intent >block_3.mass
--> 270.0
Intent >block_3.mass1
--> 8.0
Intent >
Hi,
The first argument to the function iv_PropertyPut should be an Intent Part. The implementation tries to find the Inventor Document that owns the property.
In your case, Block will not have the Inventor Document behind it, so Intent will try to find the Document in Block's parent.
If you're not able to set the mass using the default iProperties rule, as a workaround you can implement your own that calls the Inventor API, for example:
Method UpdateMass(Mass As Number) As Boolean
Try
Dim invApp As Any=%%InventorApplication
Dim activeDoc As Any=invApp.ActiveDocument
If activeDoc<>NoValue Then
If activeDoc.DocumentType=Inventor.DocumentTypeEnum.kPartDocumentObject Or _
activeDoc.DocumentType=Inventor.DocumentTypeEnum.kAssemblyDocumentObject Then
Dim massprops As Any=activeDoc.ComponentDefinition.MassProperties
massprops.Mass=Mass
Return True
End If
End If
Return False
Catch Error
Return False
End Try
End Method
Can't find what you're looking for? Ask the community or share your knowledge.