gisanalyst Posted July 27, 2016 Posted July 27, 2016 (edited) Hi , is there any command to list the vertex of a multipolygon? Cause, when I have a polygon I can use (entget (car (entsel))) and recover its vertex. But how could I do this in a multipolygon? Thanks. #Autocad Civil 3D 2015. Edited July 27, 2016 by gisanalyst Quote
Hippe013 Posted July 27, 2016 Posted July 27, 2016 The vertex of the mpolygon (dxf code 10) appear to deltas relating to the origin (dxf code 11). You can use the entget as you had stated to get the entity data. Then use assoc to retrieve the vertex deltas (dxf code 10) and the origin (dxf code 11). I hope that this helps. Quote
gisanalyst Posted July 27, 2016 Author Posted July 27, 2016 The vertex of the mpolygon (dxf code 10) appear to deltas relating to the origin (dxf code 11). You can use the entget as you had stated to get the entity data. Then use assoc to retrieve the vertex deltas (dxf code 10) and the origin (dxf code 11). I hope that this helps. yeah, I gotcha... Tks 4 help. Quote
BIGAL Posted July 28, 2016 Posted July 28, 2016 The quick search suggests multpolygons are in fact plines so can get at vertices pretty easy using VL which supports the property 'Coordinates so you retrieve all in one step. There is a few variations on this around. Lee-mac has a real nice one. ; pline co-ords example ; By Alan H (defun getcoords (ent) (vlax-safearray->list (vlax-variant-value (vlax-get-property (vlax-ename->vla-object ent) "Coordinates" ) ) ) ) (defun co-ords2xy () ; convert now to a list of xy as co-ords are x y x y x y if 3d x y z x y z (setq len (length co-ords)) (setq numb (/ len 2)) ; even and odd check required (setq I 0) (repeat numb (setq xy (list (nth i co-ords)(nth (+ I 1) co-ords) )) ; odd (setq xy (list (nth i co-ords)(nth (+ I 1) co-ords)(nth (+ I 2) co-ords) )) (setq co-ordsxy (cons xy co-ordsxy)) ; this is a list of the vertices (setq I (+ I 2)) ) ) ; program starts here (setq co-ords (getcoords (car (entsel "\nplease pick pline")))) (co-ords2xy) ; list of 2d points making pline Quote
gisanalyst Posted July 28, 2016 Author Posted July 28, 2016 Wow, I will analyse it... my script has almost 100 lines... ;( Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.