How to remove all the horizontal and vertical constraints

How to remove all the horizontal and vertical constraints

gparamasivam
Enthusiast Enthusiast
4,268 Views
14 Replies
Message 1 of 15

How to remove all the horizontal and vertical constraints

gparamasivam
Enthusiast
Enthusiast

Hello Everyone,

How to remove the all horizontal and vertical constraints in all the sketches with single shot or automatically.

If is this possible, Kindly guide me..

 

Advance Thanks...

0 Likes
Accepted solutions (1)
4,269 Views
14 Replies
Replies (14)
Message 2 of 15

Casey.P
Advocate
Advocate

Hi @gparamasivam ,

 

So far, the best way I figured is if you hold control and left click select the constraints that you want to delete. Once you have them all selected, just hit the delete button....

 

You could window drag and then deselect all of the features and constraints that you don't want to delete, but I think this section option will take longer.

0 Likes
Message 3 of 15

JDMather
Consultant
Consultant

Rotate.

Rotate.png


-----------------------------------------------------------------------------------------
Autodesk Inventor 2019 Certified Professional
Autodesk AutoCAD 2013 Certified Professional
Certified SolidWorks Professional


Message 4 of 15

imajar
Advisor
Advisor

I think @JDMather  solution is the best to solve your specific problem, but you can also select all the geometry, right click and select delete all constraints.  The drawback, is it will also wipe out the other constraints (except coincident).

 

Capture.JPG


Aaron Jarrett, PE
Inventor 2019 | i7-6700K 64GB NVidia M4000
LinkedIn

Life is Good.
0 Likes
Message 5 of 15

JDMather
Consultant
Consultant

Can you Attach your file here?

I can't help but wonder why you would want to do this.

In 15 years of using Inventor - I have never seen this need posted here before.

 

Turning the sketch into a Sketch Block, might be another option...


-----------------------------------------------------------------------------------------
Autodesk Inventor 2019 Certified Professional
Autodesk AutoCAD 2013 Certified Professional
Certified SolidWorks Professional


0 Likes
Message 6 of 15

gparamasivam
Enthusiast
Enthusiast

It will delete the all parallel and perpendicular constraints also,

I need only delete the horizontal and vertical constraints  

0 Likes
Message 7 of 15

gparamasivam
Enthusiast
Enthusiast

In iFeature sketches should not have the horizontal and vertical constraints because it may cause make some issue on iFeature. So we have a to do not use horizontal and vertical constraints in iFeature sketches.

Hope you will understand our issue.

0 Likes
Message 8 of 15

JDMather
Consultant
Consultant

@gparamasivam wrote:

So we have a to do not use horizontal and vertical constraints in iFeature sketches.

Hope you will understand our issue.


Ah, now I understand.  And I was incorrect in my previous statement. 😮


-----------------------------------------------------------------------------------------
Autodesk Inventor 2019 Certified Professional
Autodesk AutoCAD 2013 Certified Professional
Certified SolidWorks Professional


Message 9 of 15

gparamasivam
Enthusiast
Enthusiast

No problem, thank you for your suggestion 

0 Likes
Message 10 of 15

CGBenner
Community Manager
Community Manager

@gparamasivam  Did the information provided by answer your question? If so, would you please use Accept Solution so that others may find this in the future? Thank you very much!

Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button.  Thanks and Enjoy!


Chris Benner
Community Manager

Message 11 of 15

gparamasivam
Enthusiast
Enthusiast

No, still I did not get the right answer

0 Likes
Message 12 of 15

CGBenner
Community Manager
Community Manager

@gparamasivam 

 

Aside from the suggestions you have received here, I think you might be looking at the need to create an iLogic solution to do this automatically.  I'm not certain that it is even possible with iLogic, but you could try posting in the Inventor Customization forum, maybe one of the experts there will have a suggestion.

Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button.  Thanks and Enjoy!


Chris Benner
Community Manager

0 Likes
Message 13 of 15

gparamasivam
Enthusiast
Enthusiast

Thank you for your suggestion 

0 Likes
Message 14 of 15

mcgyvr
Consultant
Consultant
Accepted solution

@gparamasivam 

Here you go this will delete all horizontal and vertical constraints in a part in all sketches..

Dim oPartDoc As PartDocument
Dim oSketch As PlanarSketch

Dim geoconstraint As GeometricConstraint

On Error Resume Next

oPartDoc = ThisApplication.ActiveDocument

For Each oSketch In oPartDoc.ComponentDefinition.Sketches
For Each geoconstraint In oSketch.GeometricConstraints
	If geoconstraint.Type = kHorizontalConstraintObject Then
		'MsgBox ("Deleting Horizontal Constraints")
Call geoconstraint.Delete
Else If geoconstraint.Type = kVerticalConstraintObject Then
			'MsgBox ("Deleting Vertical Constraints")
Call geoconstraint.Delete
End If
Next geoconstraint

Next oSketch

MsgBox ("All Horizontal and Vertical constraints deleted!")


-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 15 of 15

gparamasivam
Enthusiast
Enthusiast

Thank you, 

It is working and very useful to us.

0 Likes