
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Ok guys, I'd like to start by saying this is my first dive into iLogic. I haven't done any tutorials yet but just dabbled on my own. Hopefully this gets easier after more reading and some guidance. I know a touch of C++ and this is somewhat foreign to me.
Anywho, here is what I am trying to accomplish.
I have a model with a few parameters. I need to show these values in a table in a dwg. Thus far it's being done with a symbol and prompted entry, to where I have to manually enter all of the data that is already a parameter in the model file. I am trying to automate this process. What I think needs to happen is as follows-
-Model gets loaded as base view
-iLogic is run; takes model's user parameters and converts them to custom iProperties in the dwg file.
-iLogic then takes this info, generates a table and spits out all of the parameters for you
Easier said than done for someone who doesn't computer good. Here is what I have so far (dont laugh)
SyntaxEditor Code Snippet
iProperties.Value("Custom", "Y1")= Parameter("Test Tube two.ipt.y1") iProperties.Value("Custom", "Y2")= Parameter("Test Tube two.ipt.y2") iProperties.Value("Custom", "Y3")= Parameter("Test Tube two.ipt.y3") iLogicVb.UpdateWhenDone = True
(btw, i have no idea what the last line of code does)
This works fine for the above, although I have to run the rule after every edit to the parameters in my model file; using this i get the custom iproperties I want and have them displayed in a table, but i have to create the custom properties first in a template.
Here is my first snag of many to come- the code doesnt know what to do when I upload a different model to the dwg. Say I upload filename "test tube 3", then the rule still searches for "Test Tube two" and returns value 0.0 for all of these parameters. Is there a way to assign the current loaded model's filename to a variable (String maybe?) that replaces "Test Tube two.ipt" in the above code, such that each model gets scanned, and the code will retrieve data from the current loaded model? I am building a template and want to be able to load any model with these parameters to it without having to re-write code every time.
Snag 2- This should be a loop, where "test tube two" would be replaced by a function of some variable-
string prop = "y[i]"; //property y1,y2 etc iterates
string fname = *some code that retrieves current model filename*; //declaring variable equal to loaded model filename
for(int i=1; i<=*some model parameter from loaded model*, i++){ //loop to retrieve all parameters within given range
iProperties.Value("Custom", prop)= Parameter("fname.ipt.prop") // sets custom property equal to filename parameter
} endl;
or something like that.. excuse my poor programming. I could never be software guy. I suppose I just dont know the syntax/VBA.
TL;DR
How do I set up the first code posted to read ANY model that's loaded, not just the one that's been hard coded?
How do I set up the loop to iterate like above?
Thanks for your time,
D.M.
Solved! Go to Solution.