masterfal Posted November 13 Posted November 13 Hi, I've got a bunch of different routines i use for selecting various types of objects in a job. trying to set one up for selecting all revision clouds but i'm a little unsure how to tweak it. The code below selects all the hatch patterns. was hoping i could simply change "hatch" to "revcloud" but that doesn't seem to work unfortunately. Any help much appreciated! (defun c:ah (/ sel1) (setq sel1 (ssget "_x" '((0 . "hatch")))) (sssetfirst nil sel1) (princ) ) Quote
masterfal Posted November 13 Author Posted November 13 (edited) all good i worked it out. i thought revclouds was its own specific object but it isnt.. falls under LWPOLYLINE but if you search that it will find every other polyline in your job. Lucky i use clouds in specific layers so was able to search for polylines on those layers only to get them selected. code below for anyone interested (defun c:arev (/ sel1) (setq sel1 (ssget "_x" '((0 . "LWPOLYLINE") (-4 . "<or") (8 . "layername1") (8 . "layername2") (8 . "layername3")(-4 . "or>")))) (sssetfirst nil sel1) (princ) ) Edited November 13 by SLW210 Replace Quote Tags with Code Tags!! Quote
BIGAL Posted November 13 Posted November 13 Just a hint (setq sel1 (ssget "_x" '((0 . "LWPOLYLINE") (8 . "layername1,layername2,layername3")))) Over at other forum in later versions of acad there is a class property "Revcloud" will try to find was today. 1 Quote
Nikon Posted November 13 Posted November 13 (edited) You can watch here: https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polyline-rev-clouds-and-dxf-codes/td-p/7337789 Edited November 13 by Nikon Quote
BIGAL Posted November 13 Posted November 13 Try this, reveals xdata. (defun c:getXData ( / ename edata ) (if (setq ename (car (entsel "\nSelect entity to read xdata: "))) (progn (setq edata (entget ename '("*"))) (if (setq xdata (cdr (assoc -3 edata))) (foreach item xdata (print item) ) (princ "\nEntity has no xdata.") ) ) ) (princ) ) ("RevcloudProps" (1070 . 0) (1040 . 2.5)) Quote
masterfal Posted November 14 Author Posted November 14 18 hours ago, Nikon said: You can watch here: https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polyline-rev-clouds-and-dxf-codes/td-p/7337789 interesting read.. guess im lucky we use a specific layer for revclouds so it seems to select them with no issues.. (no other polylines to select) Quote
masterfal Posted November 14 Author Posted November 14 4 hours ago, BIGAL said: Try this, reveals xdata. (defun c:getXData ( / ename edata ) (if (setq ename (car (entsel "\nSelect entity to read xdata: "))) (progn (setq edata (entget ename '("*"))) (if (setq xdata (cdr (assoc -3 edata))) (foreach item xdata (print item) ) (princ "\nEntity has no xdata.") ) ) ) (princ) ) ("RevcloudProps" (1070 . 0) (1040 . 2.5)) i use lee mac's entity list program. i'm assuming it does the same or similar thing. good to see i went through the correct process when i was trying to work it out myself Quote
masterfal Posted November 14 Author Posted November 14 19 hours ago, BIGAL said: Just a hint (setq sel1 (ssget "_x" '((0 . "LWPOLYLINE") (8 . "layername1,layername2,layername3")))) Over at other forum in later versions of acad there is a class property "Revcloud" will try to find was today. my properties tells me its an actual revcloud. thats what made me think (0 . "REVCLOUD") would work Quote
BIGAL Posted November 14 Posted November 14 At top level. Use (entget (car (entsel "\nPick object ")) so if don't see say Revcloud then it may exist at a sub level, dxf 0 is at top level. A Revcloud is like a sub property and the Properties panel reads that sub level if it exists, a good example is attributes. Similar with Dumpit.lsp it does not show "Revcloud" as a property. Dumpall properties does not show revcloud as a property either. So sometimes have to dig a lot deeper, or just ask for help, so many people in the past have helped me with a tricky request. The block has 20 attributes but no sign of it here. ((-1 . <Entity name: 8781e420>) (0 . "INSERT") (5 . "D998") (330 . <Entity name: 7fb611b0>) (100 . "AcDbEntity") (67 . 1) (410 . "D01") (8 . "DRGTEXT") (100 . "AcDbBlockReference") (66 . 1) (2 . "DA1DRTXT") (10 0.0 0.0 0.0) (41 . 1.0) (42 . 1.0) (43 . 1.0) (50 . 0.0) (70 . 0) (71 . 0) (44 . 0.0) (45 . 0.0) (210 0.0 0.0 1.0)) Quote
Nikon Posted November 14 Posted November 14 3 hours ago, masterfal said: guess im lucky we use a specific layer for revclouds so it seems to select them with no issues.. If "Revcloud" is on a separate layer, you can simply isolate this layer and delete the objects... But if you want to practice lisp, then good luck... Quote
pkenewell Posted November 15 Posted November 15 @masterfal FYI - Check out this link: https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/seek-a-lisp-to-change-revclound-to-polygon-with-specific-layer/td-p/13144708 specifically, the rev2poly.lsp file. Since AutoCAD 2024, there is a easier way to differentiate a revcloud from a Polyline. 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.