Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using ilogic to fill out Iproperties

11 REPLIES 11
Reply
Message 1 of 12
-ianf-
2241 Views, 11 Replies

Using ilogic to fill out Iproperties

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.

Ian Farmery
Inventor & Vault 2023

Dell 7550 Xeon E-2276M, 2.80Ghz 64GB RAM
Nvidia Quadro RTX 4000
11 REPLIES 11
Message 2 of 12
Breeze104
in reply to: -ianf-

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.

Message 3 of 12
mcgyvr
in reply to: -ianf-



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

***********************************************



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 4 of 12
Curtis_Waguespack
in reply to: -ianf-

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

 

 

Message 5 of 12
-ianf-
in reply to: -ianf-

Thank you all.

I have acheived exactly whet I wanted.

Ian Farmery
Inventor & Vault 2023

Dell 7550 Xeon E-2276M, 2.80Ghz 64GB RAM
Nvidia Quadro RTX 4000
Message 6 of 12
Breeze104
in reply to: -ianf-

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.

Message 7 of 12
mcgyvr
in reply to: Breeze104


@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



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 8 of 12
Breeze104
in reply to: -ianf-

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.

 

Message 9 of 12

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

 

 

Message 10 of 12
mcgyvr
in reply to: Curtis_Waguespack

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



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 11 of 12
Breeze104
in reply to: -ianf-

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.

Message 12 of 12
Breeze104
in reply to: Breeze104

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report