Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
sreed
429 Views, 3 Replies

custom iproperties to parameters for sheet metal

Hello,

 

I have a sheet metal template that uses custom iproperties to figure out the length and width of the flat pattern on the piece of sheet metal.  I use  <sheet metal length> and <sheet metal width>.   I am trying to get these custom iproperties to show up in the user parameters.  Does anyone have any idea of how to do this?

HideoYamada
in reply to: sreed

Hello sreed,

 

iLogic will help you

 

SheetMetalLength = iProperties.Value("Custom", "sheet metal length")
SheetMetalWidth = iProperties.Value("Custom", "sheet metal width")

Here 'SheetMetalLength' and 'SheetMetalWidth' are user parameters.

Keep mind that the change of custom iProperty cannot invoke the rule.

So you should invoke this rule manually when the iProperty has been changed, and set this rule to the trigger, such as 'Before Save Document', to minimize the risk of forgetting to invoke the rule.

(Does anyone know a better way?)

 

=====

Freeradical

 Hideo Yamada

 

 

 

=====
Freeradical
 Hideo Yamada
https://www.freeradical.jp
sreed
in reply to: HideoYamada

I receive an error when I try to run the rule that states

 

"Conversion from string "14.000 in" to type 'Double ' is not valid"

The 14.000 in is my length.  

 

How do I convert the "in"

 

Any help is appreciated

HideoYamada
in reply to: sreed

Hi,

 

Change the code as follows :

ThisDoc.Document.ComponentDefinition.Parameters.UserParameters("SheetMetalLength").Expression = iProperties.Value("Custom", "sheet metal length")
ThisDoc.Document.ComponentDefinition.Parameters.UserParameters("SheetMetalWidth").Expression = iProperties.Value("Custom", "sheet metal width")

This will work even if the custom iProperty contains unit.

 

=====

Freeradical

 Hideo Yamada

 

=====
Freeradical
 Hideo Yamada
https://www.freeradical.jp