PDA

View Full Version : Getting length of sides of a rectangle/square


tany0070
2007-03-15, 04:05 AM
hi pple, just want to know, if a square or rectangle is drawn using the POLYGON RECTANG functions is there anyways to get the length or width of the shape. i tried using entget to get the info out but got stuck being there is no (11. x x x) entity info inside. pls help. thanks

.T.
2007-03-15, 06:19 AM
hi pple, just want to know, if a square or rectangle is drawn using the POLYGON RECTANG functions is there anyways to get the length or width of the shape. i tried using entget to get the info out but got stuck being there is no (11. x x x) entity info inside. pls help. thanks

What version are you using?

They can either be heavy (old style) or light weight polylines.

For light weight polylines (lwpolyline), when you (entget (car (entsel))) or (entget (ssname sel_set index))) them, there will be multiple dxf code 10's that contain the x and y of each point on the polyline. Each one is a point on the rectangle, so there should be 4 in your case. Hint: the entity data returned by entget is a list.

For heavy polylines, use entnext to step throught the verti until you get to "sequend". Each verti will have its own dxf code 10. I doubt you will need to do this though, if your software is somewhat up to date.

tany0070
2007-03-15, 07:23 AM
What version are you using?

They can either be heavy (old style) or light weight polylines.

For light weight polylines (lwpolyline), when you (entget (car (entsel))) or (entget (ssname sel_set index))) them, there will be multiple dxf code 10's that contain the x and y of each point on the polyline. Each one is a point on the rectangle, so there should be 4 in your case. Hint: the entity data returned by entget is a list.

For heavy polylines, use entnext to step throught the verti until you get to "sequend". Each verti will have its own dxf code 10. I doubt you will need to do this though, if your software is somewhat up to date.
got it,thanks. oh and i'm using the 2004 version, would that be considered as "somewhat up-to-date"??

.T.
2007-03-15, 06:24 PM
got it,thanks. oh and i'm using the 2004 version, would that be considered as "somewhat up-to-date"??

You're welcome.

Yes, lwpolylines strarted before then, so you are probably using them.