Inventor General Discussion

Inventor General Discussion

Reply
Active Contributor
-ianf-
Posts: 28
Registered: ‎01-07-2010
Message 1 of 12 (813 Views)

Using ilogic to fill out Iproperties

813 Views, 11 Replies
01-30-2012 06:18 AM

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 2010 Pro SP4, Vault Collaboration 2010
HP Z820 Xeon E5-2643 0 @ 3.3Ghz 16.0GB RAM
Nvidia Quadro 5000
Distinguished Contributor
Breeze104
Posts: 218
Registered: ‎01-17-2008
Message 2 of 12 (810 Views)

Re: Using ilogic to fill out Iproperties

01-30-2012 06:44 AM 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.

*Expert Elite*
mcgyvr
Posts: 7,248
Registered: ‎12-01-2004
Message 3 of 12 (803 Views)

Re: Using ilogic to fill out Iproperties

01-30-2012 07:08 AM 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

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

Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

-------------------------------------------------------------------------------------
2015 Product Design Suite Ultimate
Windows 7 64 bit
Core i7 4820k processor (OC'd to 4.4Ghz), Nvidia GTX 770, 16G RAM


*Expert Elite*
Curtis_Waguespack
Posts: 3,002
Registered: ‎03-08-2006
Message 4 of 12 (783 Views)

Re: Using ilogic to fill out Iproperties

01-30-2012 07:50 AM 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

 

 



  solution.png  Did you find this reply helpful ? If so please use the Accept as Solution or  Kudos button below.





Active Contributor
-ianf-
Posts: 28
Registered: ‎01-07-2010
Message 5 of 12 (759 Views)

Re: Using ilogic to fill out Iproperties

01-31-2012 07:02 AM in reply to: -ianf-

Thank you all.

I have acheived exactly whet I wanted.

Ian Farmery
Inventor 2010 Pro SP4, Vault Collaboration 2010
HP Z820 Xeon E5-2643 0 @ 3.3Ghz 16.0GB RAM
Nvidia Quadro 5000
Distinguished Contributor
Breeze104
Posts: 218
Registered: ‎01-17-2008
Message 6 of 12 (747 Views)

Re: Using ilogic to fill out Iproperties

01-31-2012 09:27 AM 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.

*Expert Elite*
mcgyvr
Posts: 7,248
Registered: ‎12-01-2004
Message 7 of 12 (736 Views)

Re: Using ilogic to fill out Iproperties

01-31-2012 11:58 AM in reply to: Breeze104

Breeze104 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

Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

-------------------------------------------------------------------------------------
2015 Product Design Suite Ultimate
Windows 7 64 bit
Core i7 4820k processor (OC'd to 4.4Ghz), Nvidia GTX 770, 16G RAM


Distinguished Contributor
Breeze104
Posts: 218
Registered: ‎01-17-2008
Message 8 of 12 (732 Views)

Re: Using ilogic to fill out Iproperties

01-31-2012 12:10 PM 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.

 

*Expert Elite*
Curtis_Waguespack
Posts: 3,002
Registered: ‎03-08-2006
Message 9 of 12 (721 Views)

Re: Using ilogic to fill out Iproperties

01-31-2012 12:53 PM in reply to: Breeze104

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

 

 



  solution.png  Did you find this reply helpful ? If so please use the Accept as Solution or  Kudos button below.





*Expert Elite*
mcgyvr
Posts: 7,248
Registered: ‎12-01-2004
Message 10 of 12 (716 Views)

Re: Using ilogic to fill out Iproperties

01-31-2012 01:07 PM 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

Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

-------------------------------------------------------------------------------------
2015 Product Design Suite Ultimate
Windows 7 64 bit
Core i7 4820k processor (OC'd to 4.4Ghz), Nvidia GTX 770, 16G RAM


Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.