Inventor General Discussion

Inventor General Discussion

Reply
Distinguished Contributor
ad64
Posts: 137
Registered: ‎11-03-2006
Message 1 of 5 (311 Views)

Using ilogic to find sketch point locations

311 Views, 4 Replies
07-11-2012 01:37 PM

I would like to use iLogic to find the location of the points of a line, determine if the line is approximately vertical, and apply a vertical constraint if it is vertical.

 

Here is the code process I envision:

 

1. Automatically select a straight line.

2. Find the location of its end points.

3. Compare the X-value of the end points to see if they are vertically aligned (or almost so).

4. If they are vertically aligned, apply a vertical constraint.

5. Select next line and repeat.

 

Is this possible with iLogic? I don't see any way of calling a line's sketch points or finding their location.

 

Steve

Distinguished Contributor
FProcp
Posts: 152
Registered: ‎10-21-2009
Message 2 of 5 (300 Views)

Re: Using ilogic to find sketch point locations

07-11-2012 09:53 PM in reply to: ad64

iLogic is good at editing model parameters that have defined names such as d0, d1, "my_width", etc.

 

I don't think it can find un-named properties of objects such as lines and end-points which Lisp in AutoCAD can easily do?

Franc
inventor :-)
Distinguished Contributor
ad64
Posts: 137
Registered: ‎11-03-2006
Message 3 of 5 (284 Views)

Re: Using ilogic to find sketch point locations

07-13-2012 08:41 AM in reply to: ad64

I was actually able to solve this problem and create code that helps clean up badly constrained or dimensioned sketches. This is what it can automatically do (depending on what the user selects):

 

1. Delete all dimensions (optional).

2. Delete all constraints by type based on user input (optional).

3. Analyze the sketch and apply vertical constraints to all lines which are within a user-specified tolerance of being vertical (optional).

4. Analyze the sketch and apply horizontal constraints to all lines which are within a user-specified tolerance of being horizontal (optional).

5. Analyze the sketch and apply tangent constraints to all lines or arcs which are within a user-specified tolerance of being tangential to other arcs (optional).

 

If there is interest, I could share the code.

 

*Expert Elite*
Curtis_Waguespack
Posts: 2,878
Registered: ‎03-08-2006
Message 4 of 5 (279 Views)

Re: Using ilogic to find sketch point locations

07-13-2012 08:50 AM in reply to: ad64

Hi steve4446,

I'm interested :smileyhappy:

Thanks!
Curtis
http://inventortrenches.blogspot.com




  solution.png  Did you find this reply helpful ? If so please use the Accept as Solution or  Kudos button below.





Distinguished Contributor
ad64
Posts: 137
Registered: ‎11-03-2006
Message 5 of 5 (145 Views)

Re: Using ilogic to find sketch point locations

09-25-2013 09:55 AM in reply to: Curtis_Waguespack

Hi Curtis,

 

I realize this thread is a year old, but, if you're still interested, I've polished up this code and used it as part of the Sketch Repair Tool that I posted here:

 

http://forums.autodesk.com/t5/Autodesk-Inventor/Using-ilogic-to-find-sketch-point-locations/m-p/3537...

 

Thanks,

Steve

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.