REVCLOUD LISP to distinguish between Paper Space and Model Space?

REVCLOUD LISP to distinguish between Paper Space and Model Space?

nrz13
Advisor Advisor
762 Views
8 Replies
Message 1 of 9

REVCLOUD LISP to distinguish between Paper Space and Model Space?

nrz13
Advisor
Advisor

Here is the current LISP I use for REVCLOUD:
(DEFUN C:RC ()(COMMAND "REVCLOUD")(while (= 1 (getvar "cmdactive"))(command pause))
(COMMAND "-LAYER" "M" "Notes_Revisions" "C" "T" "255,0,0" "" "S" "0" "")
(COMMAND "CHPROP" "LAST" "" "LA" "Notes_Revisions" "")
(PRINC))

What I'd like to do is have the REVCLOUD determine if it is in paper space or model space and adjust it's arc length scale accordingly.  Most revision clouds get added in paper space, but occasionally one will need to be added in model space, but it's near-impossible to close because the arcs are microscopic (and doesn't look good graphically either).

I don't think there's a perfect way to do this because drawings can be at different scales, but here are the arc lengths I use most often:
Paper Space:  min 1/8", max 1/4"
Model Space:  min 24", max 48"

I'm looking for the syntax to modify my LISP above to add something like:
if in Model space (or inside a viewport in paper space), set arc lengths to 24" and 48"
if in Paperspace (outside of a viewport), set arc lengths to 1/8" and 1/4"

Then, if I needed to make manual adjustments outside those most common scenario above, I'd still be able to manually change it, so it would run something like:
Run REVCLOUD > Set typical arc lengths based on model/paper space > prompt for user input (start point or setting arc lengths manually and then selecting start point) > draw revision cloud > put revision cloud on layer per my existing LISP I shared above

Thanks!


Work:  AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-8700K, 32GB RAM, Samsung 960 Pro SSD, AMD Radeon Pro WX 5100, 3 Dell Monitors (3840x2160)
Home: AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-11700, 64GB RAM, Samsung 980 Pro SSD, NVIDIA Quadro P2200, Dell Monitor (3840x2160)
0 Likes
Accepted solutions (1)
763 Views
8 Replies
Replies (8)
Message 2 of 9

pendean
Community Legend
Community Legend
@nrz13 It's almost like REVCLOUD should have been annotative so it will auto-resize....

Here is a dumb question.... why 'revcloud' in paperspace at all? Or do you folks annotate and dimension there and never in modelspace?
0 Likes
Message 3 of 9

nrz13
Advisor
Advisor

Yes, all notes and dimensions are in paper space.


Work:  AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-8700K, 32GB RAM, Samsung 960 Pro SSD, AMD Radeon Pro WX 5100, 3 Dell Monitors (3840x2160)
Home: AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-11700, 64GB RAM, Samsung 980 Pro SSD, NVIDIA Quadro P2200, Dell Monitor (3840x2160)
0 Likes
Message 4 of 9

ronjonp
Advisor
Advisor
Accepted solution

Give this a try. I modified my revcloud code to account for your layer name and arc lengths.

 

(defun c:rc (/ *error* e f ln n vals vars)
  ;; RJP » 2023-04-21
  ;; Creates a freehand calligraphy cloud on layer "Notes_Revisions" that is color 255,0,0
  (defun *error* (msg)
    (if	(not (wcmatch msg "Function cancelled,quit / exit abort,console break,end"))
      (princ (strcat "\nError: " msg))
    )
    (mapcar 'setvar vars vals)
    (princ)
  )
  (setq f (tblobjname "layer" (setq ln "Notes_Revisions")))
  ;; These are the scales you requested
  ;; If you use dimscale or something to differentiate scaled drawings it can be refined even more.
  (setq	n (if (> (getvar 'cvport) 1)
	    24.
	    0.125
	  )
  )
  (setq vars '(revcloudarcstyle revcloudarcvariance revcloudapproxarclen revcloudcreatemode))
  (setq vals (mapcar 'getvar vars))
  (mapcar 'setvar vars (list "Calligraphy" 0 n 0))
  (setq e (entlast))
  (initcommandversion)
  (command-s "_.revcloud")
  (or (equal e (setq e (entlast))) (entmod (append (entget e) (list (cons 8 ln)))))
  ;; Make layer RGB red if it did not exist already
  (or f (entmod (append (entget (tblobjname "layer" ln)) '((420 . 16711680)))))
  (mapcar 'setvar vars vals)
  (princ)
)

 

 

 

 

 

Message 5 of 9

nrz13
Advisor
Advisor

Thanks @ronjonp !

It appears to be working perfectly, except mine always defaulted to Freehand instead of Polygonal.  I can't see what in your script is calling for the polygonal every time.


Work:  AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-8700K, 32GB RAM, Samsung 960 Pro SSD, AMD Radeon Pro WX 5100, 3 Dell Monitors (3840x2160)
Home: AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-11700, 64GB RAM, Samsung 980 Pro SSD, NVIDIA Quadro P2200, Dell Monitor (3840x2160)
0 Likes
Message 6 of 9

ronjonp
Advisor
Advisor

@nrz13 I updated the code above .. give it a try 🙂

 

I changed the revcloudcreatemode to 0.

Message 7 of 9

nrz13
Advisor
Advisor

@ronjonp 
That's perfect – thanks so much!


Work:  AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-8700K, 32GB RAM, Samsung 960 Pro SSD, AMD Radeon Pro WX 5100, 3 Dell Monitors (3840x2160)
Home: AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-11700, 64GB RAM, Samsung 980 Pro SSD, NVIDIA Quadro P2200, Dell Monitor (3840x2160)
0 Likes
Message 8 of 9

jwylie2020
Advocate
Advocate

With exception to rev clouds I prefer all plan annotation in modelspace

 

When it comes to the Rev cloud you have worky about the scale and where all the cloud will show up in viewport and potentialy different scales. If you have s plan area on 2 sheets the revcloud is cut off. So I just find it simpler for the revcloud to be in paperspace.

JL
C3D 2024
Win 11 Pro
0 Likes
Message 9 of 9

ronjonp
Advisor
Advisor

@nrz13 Glad to help 👍

I'm not sure why this isn't a standard feature honestly.