Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to distinguish flat surface from not flat surface

1 REPLY 1
Reply
Message 1 of 2
Anonymous
418 Views, 1 Reply

How to distinguish flat surface from not flat surface

How to determine when surfase is a flat surface. Look to attachment .
In autoCAD exist any properties or way how determine when selected surface is a flat surface.

 

Flat surface:
flat surface.png

 

Not flat surface:

surface.png

1 REPLY 1
Message 2 of 2
Kent1Cooper
in reply to: Anonymous


@Anonymous wrote:

How to determine when surfase is a flat surface. ....


For object types that qualify in the "curve" class [perhaps not your images]:

 

(vl-load-com); if needed

(vlax-curve-isPlanar (car (entsel)))

 

Then pick something -- returns T if it's flat, nil if it's not.

 

For other kinds of things, if one is flat and lies in or parallel to the WCS construction plane, you could get its bounding box and compare the Z coordinates of the corners -- if they're the same, it's flat.  The same could be done for something flat in any orthogonal plane, by comparing different coordinates of the corners.

 

If it's not parallel to an orthogonal plane, and it's something that defines a UCS, a similar approach could be taken, aligning the UCS with it and involving the (trans) function when comparing coordinates.

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report