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

hubert.groen
Participant
Participant

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

hubert.groen
Participant
Participant

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 :))

0 Likes
Reply
Accepted solutions (1)
784 Views
3 Replies
Replies (3)

WCrihfield
Mentor
Mentor

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)

0 Likes

hubert.groen
Participant
Participant

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

0 Likes

hubert.groen
Participant
Participant
Accepted solution

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

0 Likes