custom iproperties to parameters for sheet metal

custom iproperties to parameters for sheet metal

sreed
Enthusiast Enthusiast
457 Views
3 Replies
Message 1 of 4

custom iproperties to parameters for sheet metal

sreed
Enthusiast
Enthusiast

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?

0 Likes
Accepted solutions (1)
458 Views
3 Replies
Replies (3)
Message 2 of 4

HideoYamada
Advisor
Advisor

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
Message 3 of 4

sreed
Enthusiast
Enthusiast

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

0 Likes
Message 4 of 4

HideoYamada
Advisor
Advisor
Accepted solution

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