Can iLogic access the comment field of the model parameters?

Can iLogic access the comment field of the model parameters?

cwhetten
Advisor Advisor
1,311 Views
2 Replies
Message 1 of 3

Can iLogic access the comment field of the model parameters?

cwhetten
Advisor
Advisor

I would like to be able to use iLogic to get the value of the Comment field of a model's parameters.  I have some text there that I would like to display in a sketched symbol.  Is this possible, and if so, how do I do it?  The attached image illustrates what I am seeking.

 

-cwhetten

 

Parameter Comment.png

0 Likes
Accepted solutions (1)
1,312 Views
2 Replies
Replies (2)
Message 2 of 3

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi cwhetten,

 

You can use this bit of code:

 

myComment = Parameter.Param("PDF").Comment
MessageBox.Show(myComment, "iLogic")

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

 

EESignature

Message 3 of 3

cwhetten
Advisor
Advisor

Thanks, Curtis!  All I was missing was the .Comment member of the Parameter, so you gave me just what I needed.  Since I needed to pull this parameter into a drawing, this is what I ended up doing:

 

 

Modeldoc = ThisDrawing.ModelDocument

oModelParams = Modeldoc.ComponentDefinition.Parameters

iProperties.Value("Custom", "zUnits_ADF") = oModelParams.Item("ADF").Comment
iProperties.Value("Custom", "zUnits_PDF") = oModelParams.Item("PDF").Comment
iProperties.Value("Custom", "zUnits_PHF") = oModelParams.Item("PHF").Comment

 

Works like a charm.

 

-cwhetten

0 Likes