How to Convert Normal dimension into Driven Dimension using iLogic?

How to Convert Normal dimension into Driven Dimension using iLogic?

jeeva.scientist
Enthusiast Enthusiast
625 Views
2 Replies
Message 1 of 3

How to Convert Normal dimension into Driven Dimension using iLogic?

jeeva.scientist
Enthusiast
Enthusiast

Hello, 

I have done it by using three different rules. But I want it to be done using just one rule. Please take a look at the below link. Thanks for your time,

https://forums.autodesk.com/t5/inventor-customization/how-to-convert-normal-dimension-into-driven-di...

 

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

Sergio.D.Suárez
Mentor
Mentor
Accepted solution

Hi, sorry I had not seen that message in the other thread.
Try the following rule. I think it could work

 

Dim oDoc As PartDocument = ThisApplication.ActiveDocument
Dim oCD As ComponentDefinition = oDoc.ComponentDefinition
Dim oSketch As PlanarSketch = oCD.Sketches.Item(1)
Dim oDim As DimensionConstraint

For Each oDim In oSketch.DimensionConstraints
    If oDim.Parameter.Name = "d1" Then oDim.Driven = True
	If oDim.Parameter.Name = "d0" Then oDim.Driven = False
Next

'd0 = d1 * 2
oCD.parameters("d0").value = oCD.parameters("d1").value *2

InventorVb.DocumentUpdate()
iLogicVb.UpdateWhenDone = True

For Each oDim In oSketch.DimensionConstraints
    If oDim.Parameter.Name = "d0" Then oDim.Driven = True
	If oDim.Parameter.Name = "d1" Then oDim.Driven = False
Next

 I hope this helps with your problem. Regards


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

Message 3 of 3

jeeva.scientist
Enthusiast
Enthusiast

Thank you very much @Sergio.D.Suárez

Working Proof,