TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: miquan on March 06, 2014, 11:07:12 AM
-
Dear,
I have many grid line, I just want to triangle or rectangular shape (number of sides of each cell is smaller than or equal to 4 sides).
Are there any lisp to check that?
Thanks,
Miiquan
-
Not enough information for me.
I have never seen your drawing nor do I know what ACAD objects the grid lines are made of.
Perhaps you can explain it so your receptionist could understand the question & then I would too. 8)
-
If these polygons are drawn with the command 'polygon' this would give you the number of sides.
(vlax-curve-getEndParam (car (entsel)))
-
Or
(if (setq s (ssget "_+.:E:S" '((0 . "LWPOLYLINE") (-4 . "&=") (70 . 1))))
(cdr (assoc 90 (entget (ssname s 0))))
)
-
Lee, I think that will fail if the polyline has Plinegen on. The dxf 70 is bit-coded .. so it's value could be 1 or 129 depending on Plinegen setting.
-
Lee, I think that will fail if the polyline has Plinegen on. The dxf 70 is bit-coded .. so it's value could be 1 or 129 depending on Plinegen setting.
Hence the bitwise equals mask (-4 . &=) :wink:
-
Lee, I think that will fail if the polyline has Plinegen on. The dxf 70 is bit-coded .. so it's value could be 1 or 129 depending on Plinegen setting.
Hence the bitwise equals mask (-4 . &=) :wink:
missed that ; I should look more closely, shouldn't I.
-
Dear CAB,
Sorry for not clear information.
I attached here with my grid lines, I broke them at their intersections.
I need a lisp to select all grids, after that check number of polygon cell.
If number of sides is larger than 4, these sides will be selected, and change layer (Ex: Grid_1).
Thanks,
Miquan
-
Hi Miquan,
You could use the programs shared in this thread (http://www.theswamp.org/index.php?topic=10371.0) to generate polylines for each grid cell, and then process the resulting polylines to check for those with more than 4 sides.
I hope this helps.