Inventor Engineer-to-Order

Reply
Active Contributor
alundr
Posts: 52
Registered: ‎05-31-2012
Message 1 of 8 (296 Views)

set iProperties

296 Views, 7 Replies
08-16-2012 10:48 AM

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

Employee
venkatt
Posts: 13
Registered: ‎10-31-2007
Message 2 of 8 (276 Views)

Re: set iProperties

08-16-2012 04:23 PM 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

 

 

Employee
AlexKorzun
Posts: 109
Registered: ‎11-10-2008
Message 3 of 8 (263 Views)

Re: set iProperties

08-17-2012 06:42 AM 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
Autodesk Configurator 360 / Inventor ETO team
Autodesk, Inc.

Active Contributor
alundr
Posts: 52
Registered: ‎05-31-2012
Message 4 of 8 (258 Views)

Re: set iProperties

08-17-2012 07:05 AM 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

Employee
AlexKorzun
Posts: 109
Registered: ‎11-10-2008
Message 5 of 8 (255 Views)

Re: set iProperties

08-17-2012 07:42 AM 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
Autodesk Configurator 360 / Inventor ETO team
Autodesk, Inc.

Active Contributor
alundr
Posts: 52
Registered: ‎05-31-2012
Message 6 of 8 (243 Views)

Re: set iProperties

08-17-2012 11:29 AM in reply to: AlexKorzun

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

Employee
AlexKorzun
Posts: 109
Registered: ‎11-10-2008
Message 7 of 8 (236 Views)

Re: set iProperties

08-17-2012 12:14 PM 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
Autodesk Configurator 360 / Inventor ETO team
Autodesk, Inc.

Employee
venkatt
Posts: 13
Registered: ‎10-31-2007
Message 8 of 8 (219 Views)

Re: set iProperties

08-19-2012 12:52 PM 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Manufacturing Community
The Manufacturing Community provides additional access to tips, tutorials, blogs and networking with peers.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube