Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ANY IDEA ABOUT INCRIBE A RECTANGLE

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
agent47x
451 Views, 5 Replies

ANY IDEA ABOUT INCRIBE A RECTANGLE

INSCRIBED.JPG

5 REPLIES 5
Message 2 of 6
agent47x
in reply to: agent47x

I JUST WANT TO PUT A POLYGON INSIDE A RECTANGLE IN A LISP COMMAND BUT I DONT HAVE ANY IDEA PLEASE HELP ME

 

Message 3 of 6
hmsilva
in reply to: agent47x

Do you want to create the polygon or the rectangle?

Henrique

EESignature

Message 4 of 6
Kent1Cooper
in reply to: agent47x

If the rectangle exists, and you want to draw the Polygon inside it [which your use of "inscribe" and "put a Polygon inside" suggest], you would need to provide more information about how the corners locations of the polygon are to be determined.  If it is entirely up to the User and you just want to ensure that it meets the rectangle edges exactly, just turn on Nearest object snap mode.

 

If the polygon exists, and is a single object [mostly likely a Polyline, but could be a Block or Polyface or Region or 3DFace or Solid (2D or 3D) or maybe some other things], and you want to draw a rectangle around its extents, in simplest terms you can do this:

 

(vl-load-com) 

(defun C:DBB (/ minpt maxpt); Draw Bounding Box of selected object
  (vla-getboundingbox (vlax-ename->vla-object (car (entsel "\nSelect object: "))) 'minpt 'maxpt)
  (command "_.rectang" "_none" (vlax-safearray->list minpt) "_none" (vlax-safearray->list maxpt))
)

 

That would draw it on the current Layer.  It could be made more sophisticated, to draw it on a specified Layer, or the Layer of the selected object, and/or use options within the RECTANG command, etc.

Kent Cooper, AIA
Message 5 of 6
agent47x
in reply to: hmsilva

SIR THE RECTANGLE..BUT ITS ALREADY SOLVED  BY KENT THANKS FOR THE TIME.

Message 6 of 6
kdub_nz
in reply to: agent47x

Just for your info agent47x

http://dictionary.reference.com/browse/Inscribe

>>>  inscribe

Geometry. to draw or delineate (one figure) within another figure sothat the inner lies entirely within the boundary of the outer, touching itat as many points as possible:

to inscribe a circle in a square.
 
>>> circumscribe
Geometry.
  1. to draw (a figure) around another figure so as to touch as manypoints as possible.
  2. (of a figure) to enclose (another figure) in this manner.

 


// Called Kerry in my other life.

Everything will work just as you expect it to, unless your expectations are incorrect.

class keyThumper<T> : Lazy<T>;      another  Swamper

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

Post to forums  

Autodesk Design & Make Report

”Boost