Jump to content

Recommended Posts

Posted

All,

 

Good afternoon. I'm in the process of doing a lot of scoping on  ~ 150 drawings and client comes back with comments which affects what needs to be in the scope or not. I use a pline to draw around items that need to be scoped, then use Annotate --> Markup --> Revision Cloud and click on object (pline). My question is, does anyone know of a lisp routine that would turn my scoping arcs back to straight plines so I can make my corrections and scope it back without having to draw all my plines again?

Posted (edited)

It is a pline at heart so you can get all the co-ords would need a change of angle in co-ords check ie end of line, I think there is something out there that converts short line segments to a single line or pline section. 

 

This is rough note that revcloud tends to fillet corners.

(defun c:foo ( / ent lst)
(setq ent (entsel "pick revcloud"))
(setq lst '())
(setq lst (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car ent)))))
(command "erase" ent "")
(entmakex (append (list (cons 0 "LWPOLYLINE")
                          (cons 100 "AcDbEntity")
                          (cons 100 "AcDbPolyline")
                          (cons 90 (length lst))
                          (cons 70 1))
                   (mapcar (function (lambda (p) (cons 10 p))) lst))
)
)
Edited by BIGAL
  • Like 1
Posted

Thanks Big Al, that will make tings easier for me too.

 

I would also add an (entdel (car ent)) to remove the original revision cloud

 

  (setq lst (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car ent)))))
  (entdel (car ent))
  (entmakex (append (list (cons 0 "LWPOLYLINE")

 

Posted

I left it there for moment to show difference in the shape not true if you start with a rectang chamfers corners.

Posted

BIGAL StevenP,

 

I get ; error: syntax error when loading BIGAL's lisp. Do you know why? Steven, could you do me a favor and combine BIGAL'S Lisp with your (entdel (car ent)) and post it please? I would appreciate it.

 

Thank you,

David

Posted

Sorry my fault I have changed code I had a ) back to front after Foo ( added erase also

Posted

BIGAL,

 

It worked! Thank you very much for your time to help me out. I really appreciate it. Your title (CAD Guru) is well deserved along with your coding skills.

 

Thanks again,

David

Posted (edited)

You'll loose XDATA or other HYPERLINK or... data attached to REVCLOUD polyline if you apply BIGAL's code... Instead I suggest that you (entmod) your picked REVCLOUD so that all gc 42 have value 0.0 - meaning no bulges only staight segements...

 

(defun c:lwst ( / rc )
  (while
    (or
      (not (setq rc (car (entsel "\nPick REVCLOUD..."))))
      (if rc
        (or
          (/= (cdr (assoc 0 (entget rc))) "LWPOLYLINE")
          (= 4 (logand 4 (cdr (assoc 70 (tblsearch "LAYER" (cdr (assoc 8 (entget rc))))))))
        )
      )
    )
    (prompt "\nMissed or picked wrong entity type, or picked LWPOLYLINE on locked layer...")
  )
  (entupd (cdr (assoc -1 (entmod (mapcar '(lambda ( x ) (if (= (car x) 42) (cons 42 0.0) x)) (entget rc))))))
  (princ)
)

HTH., M.R.

Edited by marko_ribar
Posted

marko_ribar,

 

Thank you so much for your input, I tried it and it kept my pline width. I appreciate it.

 

Thanks,

David

Posted

BIGAL and marko_ribar,

 

One last request, If i draw a rectang, which is a polyline then I go to Annotate --> Markup --> Revision cloud, pick rectang and it draws my cloud (scoping). When i use both of your routines, it creates single line segments exploded or not, length deepening on arc size. Is there a way that a lisp routine can make it 4 lines when I drew my rectang, depending on the width and length of rectang without having ends chamfered? If this is confusing, please let me know and I will try to explain it better.

 

Thank you do much,

David

Posted

The issue is the way revcloud works that it puts bulges on corners so need a remove chamfers routine, thinking about it now Bounding box will do what you want.

 

 

; convert a rectang revcloud back to plain rectang
; By Alan H June 2019


(defun c:AH-boundrevc ( / ent pointmin minpoint maxpoint pointmax x1 x2 y1 y2)
(setq ent (entsel "Pick revcloud"))
(command "pedit" ent "_D" "")
(vla-GetBoundingBox (vlax-ename->vla-object (car ent)) 'minpoint 'maxpoint)
(setq pointmin (vlax-safearray->list minpoint))
(setq pointmax (vlax-safearray->list maxpoint))
(setq x1 (nth 0 pointmin))
(setq y1 (nth 1 pointmin))
(setq x2 (nth 0 pointmax))
(setq y2 (nth 1 pointmax))
(command "pline" (list x1 y1) (list x2 y1) (list x2 y2) (list x1 y2) "c")
(command "erase" (car ent) "")
)
(c:AH-boundrevc)

 

Posted

BIGAL,

 

You are the man. It works like a charm. Thank you so much for taking time out to help me. I sure do appreciate it.

 

Thanks again,

David

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...