Jump to content

Have the bubble on it's own layer


Bob_W

Recommended Posts

I have attached a Lisp program that I got many years ago from Cadalyst Hot tip Harry’s.
https://cadtips.cadalyst.com/
I have no way to contact the original author, Ray Burnstad.
I would like to have the bubble be put on it’s own layer. I have looked to see how to do it but my Lisp knowledge would not fill the subject line.
Since this was a free to download and use I don’t know if there would be a problem with modifying it. If this is not allowed I understand.

Thanks
Bob_W

BUB.lsp

Link to comment
Share on other sites

Looks like it puts the bubble on the current layer. either change your current layer before running the command or

 

Change the following in the lisp.  update "layername" to the layer you want

; Main function

(defun C:BUB (/ SS TXTLIM LL UR MP NX NY P1 olay)
  (setq olay (getvar 'clayer)) ;saves current layer before changing it in next line.
  (setvar 'clayer "layername") ;layer name you want the bubble to be on.

end of main function

  (setvar 'clayer olay) ;sets current layer back to before the lisp
  (princ)
)

 

There is also an function missing in this lisp that causes it not to run successfully.

 

; ----- Error around expression -----
; (BUB_NOTE_GET_POINT)

 

Make sure you have the all of the lisp loaded.

https://cadtips.cadalyst.com/notestext/bubble-note

 

Edited by mhupp
Link to comment
Share on other sites

First - Thank You

 

FYI, the link you showed is actually a different lisp by the same author. The original bub.lsp seems to be gone. The one I originally attached runs OK

 

Using the code you provided I can now get the bubble on it's own layer. I had to make some changes, at first I could not make it work. Most likely my fault.

 

It does not change back to the current layer, again I'm probably putting it the wrong location or lost a parentheses or ???

 

Can you show where it goes, original end of main function below;

 

    (setvar "SNAPMODE" SM)
    (setvar "CMDECHO" 1)
    (setq *ERROR* OE)
    ))
  (princ)
  )

 

 

 

; Draws bubble border polyline

 

 

Link to comment
Share on other sites

2 hours ago, Bob_W said:

First - Thank You

 

FYI, the link you showed is actually a different lisp by the same author. The original bub.lsp seems to be gone. The one I originally attached runs OK

 

Using the code you provided I can now get the bubble on it's own layer. I had to make some changes, at first I could not make it work. Most likely my fault.

 

It does not change back to the current layer, again I'm probably putting it the wrong location or lost a parentheses or ???

 

Can you show where it goes, original end of main function below;

 

    (setvar "SNAPMODE" SM)
    (setvar "CMDECHO" 1)
    (setq *ERROR* OE)
    ))
  (princ)
  )

 

 

 

; Draws bubble border polyline

 

 

Add this line and you don't have to worry about the current layer changing:

image.png.0abf7ea94e85b3a8844eaa1323c77520.png

  • Agree 1
Link to comment
Share on other sites

Thank You ronjonp

That makes it work as I wanted.

I made a 'bubble' layer to set color and lineweight for the 'bubble"

I'm sure that can be done in the lisp but a layer works fine.

 

Bob_W

Link to comment
Share on other sites

I have a library routine chklay that just does that checks does layer exist, if not make it (chklay "Bubble" 2 "DASHED") .

 

Or can do (command "Layer" "M" "Bubble" "c" 2 "Bubble" "lt" "Dashed" "Bubble" "") as make layer will continue if it exists.

Edited by BIGAL
Link to comment
Share on other sites

I am not a member of the Lisperatti, so out of my depth...

but I use and love LeeMacs awesome LAYER DIRECTOR lisp

Thanks @LEEMAC ! :beer:

which would be able to do this for you.

 

When in doubt?   Check LeeMac out!  :thumbsup:

Link to comment
Share on other sites

On 10/28/2021 at 3:29 PM, Bob_W said:

Thank You ronjonp

That makes it work as I wanted.

I made a 'bubble' layer to set color and lineweight for the 'bubble"

I'm sure that can be done in the lisp but a layer works fine.

 

Bob_W


Sure it can be done.  It was stated in a way like that by @BIGAL in the post above yours.

You can also check the '-layer' (with the - in front of it) command to see what options you have to create a layer with the style you want.

Something like below (not tested!) would create a layer named 'LAYERNAME' that is megenta, not visible on plot and has a dashed linetype.

(command "-Layer" "make" "LAYERNAME" "color" "magenta" "" "plot" "n" "lt" "Dashed" "")

Link to comment
Share on other sites

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...