Control sketch dimension limits - Max & Min Values

Control sketch dimension limits - Max & Min Values

chrisw01a
Collaborator Collaborator
1,762 Views
8 Replies
Message 1 of 9

Control sketch dimension limits - Max & Min Values

chrisw01a
Collaborator
Collaborator

I require this. Does anyone have any ideas or does this exist already?

 

We are Version 2023

 

Thanks!

 

[new post created from part of older thread, link to old thread added.]

0 Likes
1,763 Views
8 Replies
Replies (8)
Message 2 of 9

johnsonshiue
Community Manager
Community Manager

Hi Chris,

 

I believe this can be done by using an iLogic rule. Please share an example you are working on. The iLogic forum experts can help take a look.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 3 of 9

pcrawley
Advisor
Advisor

As @johnsonshiue says - iLogic does make this easy.

 

Create a sketch and, to make it easy, add named dimensions to the things you want to limit.

2.jpg

Create an iLogic form.  Add the named parameters (the default setting only shows named parameters) - change the "Control Type" to "Slider" and set your max and min values.

 

Now, when you run the form, you can drag the slider between its limits - or type a value - and the model dynamically updates.

 

When creating designs involving motion, I find this sort of control indispensable.  Rotary motion is the worst for dragging - but adding an iLogic slider with an angular range makes it absolutely bullet-proof. 

Peter
Message 4 of 9

cadman777
Advisor
Advisor

Can you manually move the sketch and have it change without using the slider?
Also, can you manually move the part and make it adjust position or size without using the slider?

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 5 of 9

johnsonshiue
Community Manager
Community Manager

Hi Chris,

 

Yes, I believe both are doable using iLogic. The slider is just a way to change the parameter value. In a sketch (2016 and later), you may enable "Relax mode", where a driving dimension can be dragged (remains a driving dimension). Dragging a part in an assembly to change the shape can be done without using adaptive also.

The biggest advantage using iLogic is to allow all parameters in individual components at all levels to be available to a rule at the top-level. Without using iLogic, such relationship will have to be managed by Derive, Adaptive, or Link Parameters.

 

Hi Peter,

 

The Auto-Limit Add-In isn't enabled by default. You need to enable it. It should work.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 6 of 9

pcrawley
Advisor
Advisor

Re AutoLimits - I did enable it, and restart Inventor 2023 - but it's not there.

Peter
0 Likes
Message 7 of 9

chrisw01a
Collaborator
Collaborator

Thank you for the reply.

 

I have a fairly complex situation where multiple configurations cause two points to fall below a minimum depending on the configuration.

 

Part file attached (Minimum Dim Example.ipt)

 

Please see "Sketch1" and notice my comments on the parameters.

d6 and d3 are the driving dimensions. Neither d10 or d11 can fall below 1" and whichever one is less needs to be set to 1" but I still need to drive the angle dimension because sometimes it is set to 180° and d10 and d11 are ignored.

 

The easiest thing I think would be if d10 and d11 had a "minimum" allowed value of 1", I could set the angle to 1° but once d10 or d11 get to their minimum, the angle would just stop there so maybe it ends up being 85° even though it is set at 1°. For the second case, d6 would get set to 180° therefor it would not matter.

 

Here is how to see what I mean:

When you first open the part, you can see that d11 = 1". Perfect. Take note that d6 = 94.05° but doesn't matter at this moment.

chrisw01a_3-1678290163041.png

 

 

Now change d3 to 10". Now d10 & d11 are both too high and due to geometry change, d10 now needs to be set to 1" since it will be the closest point to the horizontal line.

chrisw01a_2-1678290122331.png

 

 

So now, d6 needs to become 77.75°

chrisw01a_1-1678290094477.png

 

 

 

chrisw01a_0-1678289649808.png

 

 

I hope this makes some kind of sense...

Thanks All.

 

 

0 Likes
Message 8 of 9

chrisw01a
Collaborator
Collaborator
This is really cool but my issue is different. I made an example here. Thank you.

https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/control-sketch-dimension-limits-max-...
0 Likes
Message 9 of 9

chrisw01a
Collaborator
Collaborator

I have this solved with the code below but can someone PLEASE show me how to turn my three parameters into objects or whatever you call it so I don't have to keep using the FOR statement? There has to be a way to run the FOR statement one time and define some local variables or something. I'm not much good with this part.

 

I am toggling dims from driven to driving so I can accommodate all my different configurations and I think it will work perfectly but would really like to simplify the code.

 

Curtis???

 

iLogicVb.UpdateWhenDone = True
Parameter.UpdateAfterChange = True

doorToFbMin = 2
Dim i As Long

'get the sketch to work with
oSketch = ThisDoc.Document.ComponentDefinition.Sketches.Item("Top of door frame s")

'If centered
If doorside = 2 Then
	'toggle from/to driven/driving
	'Dim i As Long
	For i = 1 To oSketch.DimensionConstraints.Count 
		If oSketch.DimensionConstraints.Item(i).Parameter.Name = "doorAngle" Then
			oSketch.DimensionConstraints.Item(i).Driven = False
		Exit For
		End If	
	Next
	For i = 1 To oSketch.DimensionConstraints.Count 
		If oSketch.DimensionConstraints.Item(i).Parameter.Name = "doorTopToFb" Then
			oSketch.DimensionConstraints.Item(i).Driven = True
		Exit For
		End If	
	Next
	For i = 1 To oSketch.DimensionConstraints.Count 
		If oSketch.DimensionConstraints.Item(i).Parameter.Name = "doorBottomToFb" Then
			oSketch.DimensionConstraints.Item(i).Driven = True
		Exit For
		End If	
	Next
	doorAngle = 180
Else
	'If full Round
	If fbfr = 0 Then
		'toggle from/to driven/driving
		'Dim i As Long
		For i = 1 To oSketch.DimensionConstraints.Count 
			If oSketch.DimensionConstraints.Item(i).Parameter.Name = "doorAngle" Then
				oSketch.DimensionConstraints.Item(i).Driven = False
			Exit For
			End If	
		Next
		For i = 1 To oSketch.DimensionConstraints.Count 
			If oSketch.DimensionConstraints.Item(i).Parameter.Name = "doorTopToFb" Then
				oSketch.DimensionConstraints.Item(i).Driven = True
			Exit For
			End If	
		Next
		For i = 1 To oSketch.DimensionConstraints.Count 
			If oSketch.DimensionConstraints.Item(i).Parameter.Name = "doorBottomToFb" Then
				oSketch.DimensionConstraints.Item(i).Driven = True
			Exit For
			End If	
		Next
		doorAngle = 90
	'If flat back & door RH
	ElseIf doorside = 0 Then
		'clear driving for all 3
		'Dim i As Long
		For i = 1 To oSketch.DimensionConstraints.Count 
			If oSketch.DimensionConstraints.Item(i).Parameter.Name = "doorAngle" Then
				oSketch.DimensionConstraints.Item(i).Driven = True
			Exit For
			End If
		Next
		For i = 1 To oSketch.DimensionConstraints.Count 
			If oSketch.DimensionConstraints.Item(i).Parameter.Name = "doorTopToFb" Then
				oSketch.DimensionConstraints.Item(i).Driven = True
			Exit For
			End If	
		Next
		For i = 1 To oSketch.DimensionConstraints.Count 
			If oSketch.DimensionConstraints.Item(i).Parameter.Name = "doorBottomToFb" Then
				oSketch.DimensionConstraints.Item(i).Driven = True
			Exit For
			End If	
		Next
		'Set to drive
		For i = 1 To oSketch.DimensionConstraints.Count 
			If oSketch.DimensionConstraints.Item(i).Parameter.Name = "doorAngle" Then
				oSketch.DimensionConstraints.Item(i).Driven = False
			Exit For
			End If
		Next
		
		'Set starting point
		Parameter("doorAngle") = 89
		
		'Set back to driven
		For i = 1 To oSketch.DimensionConstraints.Count 
			If oSketch.DimensionConstraints.Item(i).Parameter.Name = "doorAngle" Then
				oSketch.DimensionConstraints.Item(i).Driven = True
			Exit For
			End If			
		Next
		
		If doorBottomToFb < doorTopToFb Then
			For i = 1 To oSketch.DimensionConstraints.Count 
				If oSketch.DimensionConstraints.Item(i).Parameter.Name = "doorBottomToFb" Then
					oSketch.DimensionConstraints.Item(i).Driven = False
				Exit For
				End If	
			Next
			Parameter("doorBottomToFb") = doorToFbMin
		End If
	'If flat back & door LH
	Else
		'do something
	End If
End If

 

 

0 Likes