Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing dimension value by iLogic rule (in the drawing sheet)

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
hubert.groen
781 Views, 3 Replies

Changing dimension value by iLogic rule (in the drawing sheet)

ilogic_question.png

Hello! As shown on the attached photo:

I would like to change value "d1" in the iLogic rule.

But by "capturing current state", the program does not know where "d1" is,  in which sheet, view and sketch...

 

I would like it to access like this:

Spring:5 --> View35 --> Sketch2 --> d1 = 15

And then "d1" would change from 17.6 to 15 (and update on the drawing)

 

Thanks :))

3 REPLIES 3
Message 2 of 4
WCrihfield
in reply to: hubert.groen

Hi @hubert.groen.  The Parameter object belongs to the main document, not to a dimension or a sketch, so if you just need to change the parameter's value, why would you need to dig down through sheets, views, sketches, and dimensions to find the dimension which is using that parameter, before changing its value.  Seems like a whole lot of extra work for no purpose.  Is there maybe some other reason that you need to find the exact sketch & dimension that is using that parameter?

Maybe this 3 lines of code will work better for you than the single line of code you are currently using?

 

Dim oDDoc As DrawingDocument = ThisDrawing.Document
oDDoc.Parameters.Item("d1").Expression = "15 mm"
oDDoc.Update

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 4
hubert.groen
in reply to: WCrihfield

Thank you for the anwer!

Unfortunately it's not the case, maybe I haven't described my problem well.

I'm creating parametrized drawings, one of them is a spring. Spring drawing requires force-plot (shown on the right). As my parameters change, so the dimensions of the spring, I'd like to parametrize this "force-plot" sketch as well.

 

The problem is when I write in my Rule stricly "d1", the program does not know which "d1" I want. There are many "d1"s in different sheets, views, sketches of the same document.

 

PS

When I was using Rules in 3D model parametrization, I didn't have problem to specify desired parameter, e.g. 

Parameter("roller:1", "d0") = 15, and it worked.

 

Now I would intuitively do something like:
Parameter("Spring:5", "VIEW35", "Sketch2", "d1") = 15

 

q2.png

Message 4 of 4
hubert.groen
in reply to: hubert.groen

I post the solution I came up with:s.png

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

Post to forums  

Autodesk Design & Make Report