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: 

Exported Parameters updated through ilogic in a a part rounding to whole number

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
kmiller
1317 Views, 2 Replies

Exported Parameters updated through ilogic in a a part rounding to whole number

Hi there,

 

I have two user parameters saved in a part template that are tied to the part volume and an overall estimated part weight.  The user parameter Pc_Volume is the volume in cubic feet and calculated by pulling the part mass (in cubic inches) and converting to cubic feet via ilogic rule.  This is then automatically run via event triggers before a file is saved and if the part geometry has changed to keep the volume up to date.  These are exported because they get pulled into iproperties of our drawing files as well as used to create a parts lists showing the volumes and weights. 

 

I have the property formats of the user parameters set to Number and to unitless and the unit display turned off so it does not show on the parts list, with a precision of 0.000 for Pc_Volume.  The Pc_Weight is set the same way however with a precision rounded to the nearest whole number. 

 

These are created this way so when we use the part file as the template when we select "Make Components" to separate our parts and tie them to an assembly all the files are then updated and the information saved for exporting. 

 

The problem is, the Pc_Volume always comes in rounded to a whole number.  The Pc_Weight Does as well, but that doesn't bother me since we want it to do that anyway.  If I would go into the part file after it's created, double check the precision and then re-run the rule the volume will show up with the correct precision in the exported parameters.  I don't want to have to open each partfile however to get this to update.

 

Attached are images of the parameters, ilogic rule, and exported results. 

 

Any ideas why this might be happening? 

-------------------------------------------------------------------------------------------------

If this response answers your question please click "Accept as Solution".
2 REPLIES 2
Message 2 of 3
wayne.brill
in reply to: kmiller

Hi,

 

I was able to recreate similar behavior doing the following. (used your screenshots as a guide)

1. Created the Custom iProperties with the Type as Number.

2. Created the numeric Parameters

3. Created an iLogic rule that gets the Volume and makes one of the parameters equal to that number times another number.

3. Added an iLogic trigger that runs the rule after the ipt file is saved.

 

In the Custom iProperties tab I see the decimal values rounded off.

 

I was able to get the decimal part of the number by using the "Custom Property Format" dialog. In that dialog I made the "Property Type" a number. I attached a screenshot showing this.

 

Also if I did not first create the custom iProperties I see the iProperties created as a Text type and they have the decimals in the number. (let Inventor create the iProperties - Export)

 

I am not sure if this will solve the problem you are getting. If this does not help please provide an ipt file that will allow me to recreate the problem.

 

Thanks,



Wayne Brill
Developer Technical Services
Autodesk Developer Network

Message 3 of 3
kmiller
in reply to: kmiller

Thanks Wayne... leaving it at a text iproperty and leaving it as the export set it up worked great.  I am not sure why I didn't do that to begin with.  The only thing I can think of is maybe I thought the units string would not be able to be turned off or always displayed.  But I got it working! 

 

Thank you!

-------------------------------------------------------------------------------------------------

If this response answers your question please click "Accept as Solution".

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

Post to forums  

Autodesk Design & Make Report