So, I'm new to ilogic. My goal is to use basic ilogic to fill in some of the standard iproperty fields from parameters.
I have so far managed to populate the description iproperty with one value from the parameters using this ilogic code;
iProperties.Value("Project","Description") = length
where length is a user parameter.
Want I would like to do is build on this to include more parameters such as material thickness, width and depth etc so the resulting iproperty description field would read something like
1.2mm SS 50x100 @3000
How do I go about writing the ilogic string to include multiple values and end up filling in the one description field?
Thanks.
To answer your question...if I understand it
All you should have to do is add the lines of code (like the one you already have) you want to the begining of your rule. And then start you rule definitions. Something like this....
iProperties.Value("Project", "Project") = HopperType
iProperties.Material = "Steel, Mild"
InventorVb.DocumentUpdate(True)
iProperties.PartColor = "Red (Flat)"
I would like to add the question... How do you get the "Project" field filled, since there is no iProperties snippet for that. I was able to get it done when I only had 1 rule but as I added rules (using the same bit of code) it doesn't follow through.
How do I go about writing the ilogic string to include multiple values and end up filling in the one description field?
Thanks.
This works for me.. Just an example but it prompts for description and title then combines those 2 to fill out the revision..
*************************************************
pDescription = InputBox("Enter value for 'Description'", "Description",iProperties.Value("Project", "Description"))
If pDescription = Nothing Then Exit Sub
iProperties.Value("Project", "Description") = pDescription
pTitle = InputBox("Enter value for 'Title'", "Title",iProperties.Value("Summary", "Title"))
If pTitle = Nothing Then Exit Sub
iProperties.Value("Summary", "Title") = pTitle
iProperties.Value("Project", "Revision Number") = pTitle & PDescription
iLogicVb.UpdateWhenDone = True
***********************************************
Hi -ianf-,
In addition to the example provided by mcgyvr, here is another that used strings enclosed in " " to include further descriptions and characters. In this example the dimension d1 and d0 are written to custom iProperties, and then those custom iProperties are written to named variables with in the rule, and then finally the named variables are combined and written to the description iProperty, for a result such as 55 x 30 Plate
iProperties.Value("Custom", "Length") = d0 iProperties.Value("Custom", "Width") = d1 oLength = iProperties.Value("Custom", "Length") oWidth = iProperties.Value("Custom", "Width") iProperties.Value("Project", "Description") = oLength & " x " & oWidth & " Plate"
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Thank you all.
I have acheived exactly whet I wanted.
Which one did u use? Can u show some of the code? I am interested in how u solved the problem....as I am new and still learning as well.
@Anonymous wrote:Which one did u use? Can u show some of the code? I am interested in how u solved the problem....as I am new and still learning as well.
The basic code is all right here you just need to decide which properties you want and how you want them combined.. My example shows simply joining a few iproperties and Curtis showed how to extend that more to include custom properties and just regular text like plate
and what about the "Project" field..... It doesn't have an iProp snippet to be able to add info so it shows up in the "Projects" iProp box.
Hi Breeze104,
I might not be understanding your question, but it appears that the example you provided in your first post contains the answer you're after concerning the Project field.
For instance in this snippet, in the first line I'm hardcoding the variable HopperType to be "Big Green Hopper"
In the second line that variable is being written to the iProperty.
Is this not working?
HopperType = "Big Green Hopper"
iProperties.Value("Project", "Project") = HopperType
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
I think he (and I now) are asking why "project" and many other iproperties fields are not listed in the iproperties section in the snippit window (system tab) of the edit rule dialog. see attached
Well, went back and reread the original post and the different examples....and have come to the conclusion, that I totally misunderstood what was originally asked......my bad
I thought that the original question was just about how to get iProperties slots filled in...and not how to fill then in a particular format. Sorry for my confusion.
Also, wanted to say Thanks to Mcgyvr and Curtisfor the original responces.
Mcgyvr's post that showed that you can specify a tab and then a specific row in the iProps to fill in. I had not realized that the first part of the iProps code was the tab. Now it is making more sence and I understand the code better.
And Curtis's post was just as eye-opening for me cuz I didn't realize that the description could be formated like that.
I have been working with iLogic for a few months now and never made the connection.....I guess I am not only old but a bit slow as well...LOL