Basically what I'm trying to do within Circuit Builder is have them insert a symbol, that attaches the correct catalog lookup info, then somehow set a variable equal to the value from an attribute on that symbol (let's say RATING5), so I can then insert a second symbol, but what/which symbol depends on what value is on RATING5.
I can get the info to get set from the catalog database onto the first symbol, & I can get the different 2nd symbol to insert based upon variables, but I can't figure out a way to do an IF or COND statement off an attrible value, so I'm trying to see if I can read it from the attribute into a variable.
Any ideas?
Solved! Go to Solution.
Basically what I'm trying to do within Circuit Builder is have them insert a symbol, that attaches the correct catalog lookup info, then somehow set a variable equal to the value from an attribute on that symbol (let's say RATING5), so I can then insert a second symbol, but what/which symbol depends on what value is on RATING5.
I can get the info to get set from the catalog database onto the first symbol, & I can get the different 2nd symbol to insert based upon variables, but I can't figure out a way to do an IF or COND statement off an attrible value, so I'm trying to see if I can read it from the attribute into a variable.
Any ideas?
Solved! Go to Solution.
Solved by AJPopp. Go to Solution.
I am not sure I fully understand what you are trying to do but maybe we can work on this together offline? I have some experience with Circuit Builder and it seems like it can be done but it just might take a few tries to get it right. I want to investigate a little more the API c:ace_cb_save as it seems like it might be useful along with c:ace_cb_eval.
You can contact me directly at pat.murnen@autodesk.com. Let me know what version of AutoCAD Electrical you are using and if you can send your current circuit builder spreadsheet with ehat you have so far it would be helpful.
Regards,
Pat Murnen
I am not sure I fully understand what you are trying to do but maybe we can work on this together offline? I have some experience with Circuit Builder and it seems like it can be done but it just might take a few tries to get it right. I want to investigate a little more the API c:ace_cb_save as it seems like it might be useful along with c:ace_cb_eval.
You can contact me directly at pat.murnen@autodesk.com. Let me know what version of AutoCAD Electrical you are using and if you can send your current circuit builder spreadsheet with ehat you have so far it would be helpful.
Regards,
Pat Murnen
I worked with Pat offline & we came up with a solution. I'm posting them here incase anyone else has the same question.
Basically when using the c:ace_cb_save command, it saves the value as a string. Since I was needing a number, you had to nest a c:ace_cb_get inside a atof command to get it converted into a number.
So we used (c:ace_cb_save "@ET@" "RATING5" nil 0) to save the attribute RATING5 value as a string in @ET@ then I used (c:ace_cb_eval "(setq ETP (atof (c:ace_cb_get '@ET@' nil)))") to save that value as a number in my variable ETP, which I can then use in IF/COND commands as well as c:ace_cb_attr commands that only take a variable with a number (no strings).
I worked with Pat offline & we came up with a solution. I'm posting them here incase anyone else has the same question.
Basically when using the c:ace_cb_save command, it saves the value as a string. Since I was needing a number, you had to nest a c:ace_cb_get inside a atof command to get it converted into a number.
So we used (c:ace_cb_save "@ET@" "RATING5" nil 0) to save the attribute RATING5 value as a string in @ET@ then I used (c:ace_cb_eval "(setq ETP (atof (c:ace_cb_get '@ET@' nil)))") to save that value as a number in my variable ETP, which I can then use in IF/COND commands as well as c:ace_cb_attr commands that only take a variable with a number (no strings).
Can't find what you're looking for? Ask the community or share your knowledge.