Inventor Engineer-To-Order (Read-Only)
Welcome to Autodesk’s Inventor ETO Forums. Share your knowledge, ask questions, and explore popular Inventor ETO topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 8
alundr
637 Views, 7 Replies

set iProperties

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

 

mass iprop intent browser.jpg

 

but not here

 

mass iprop physical iprops.JPG

 

how do I pass the value through?

 

Thanks,

Andrew

7 REPLIES 7
Message 2 of 8
venkatt
in reply to: alundr

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:

 

customprops.png

 

 

Message 3 of 8
AlexKorzun
in reply to: alundr

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.

Thank you,




Alex Korzun
Inventor-Revit Interop / Inventor-Fusion Interop / Inventor ETO
Autodesk, Inc.

Message 4 of 8
alundr
in reply to: alundr

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

Message 5 of 8
AlexKorzun
in reply to: alundr

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 >

 

 

Thank you,




Alex Korzun
Inventor-Revit Interop / Inventor-Fusion Interop / Inventor ETO
Autodesk, Inc.

Message 6 of 8
alundr
in reply to: AlexKorzun

what does the iv_setProperty method do/how does it function?

Message 7 of 8
AlexKorzun
in reply to: alundr

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.

 

 

 

Thank you,




Alex Korzun
Inventor-Revit Interop / Inventor-Fusion Interop / Inventor ETO
Autodesk, Inc.

Message 8 of 8
venkatt
in reply to: AlexKorzun

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.

Post to forums  

Autodesk Design & Make Report