Preview iproperties function in dialog

Preview iproperties function in dialog

pball
Mentor Mentor
516 Views
2 Replies
Message 1 of 3

Preview iproperties function in dialog

pball
Mentor
Mentor

I'm working on my dialog for editing iproperties again and I'd like to make it preview the output of a function. We like using functions in the description for calling out material sizes using parameters. So I have my dialog get the function in the description iproperty, but if you don't know what parameters are what it can be hard to work with.

 

I'd like to show the evaluated description function so it's easier to work with.

 

Description function

=<G_H> x <G_W> x <G_T> S.S. TUBE x <G_L>

 

Evaluated description shown in BOM

4.00 in x 2.00 in x 0.19 in S.S. TUBE x 21.00 in

 

I know it'd be possible to set the iproperty and get the evaulated version after setting it. But if the user cancels out of the dialog that change would have to be undone, which would require storing the original value and resetting it on cancel. Is there a way to evaluate the function without setting it first?

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style

Userscript to edit forum links to jump to first unread post
Jump To First Post Userscript
0 Likes
517 Views
2 Replies
Replies (2)
Message 2 of 3

xiaodong_liang
Autodesk Support
Autodesk Support

Hi,


I may not understand your requirement correctly. Since the dialog is managed by you, why you just evaluate the properties yourself, without setting iProperties and getting it? i.e. when your dialog is being loaded, read all the iProperties and store them temporarily. In your dialog, you just manipulate the temporary data the preview them flexibly. finally, when the user closes your dialog, you could judge if saving the change or not.

 

0 Likes
Message 3 of 3

pball
Mentor
Mentor

I already load the iproperties when the dialog is opened and save when the save button is selected. The part I don't know, is how to evaluate a function to it's display value. That's why I'm asking for help.

 

How do you evaulate <G_H> to the value of that parameter? Which in this case is the height of a tube.

 

Since I couldn't figure out how to evaulate functions on the fly, I just made a sub routine to set the iproperty and get the new value and display that as the preview. There is also a variable with the original value incase the user cancels and the iproperty needs to reverted to the original value. So I have a work around now but if there is a way to evaulate parameters to their values, that would be preferable of course.

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style

Userscript to edit forum links to jump to first unread post
Jump To First Post Userscript
0 Likes