Jump to content

What is the code to add for the INTERSECT snap & revert to previous when done?


vernonlee

Recommended Posts

What is the code that I can add to allow the snap to be automatically INT & revert back to previous snap profile?

 

This is a LISP concern. It is to break lines & it does so continuously breaking lines until the command is canceled.

 

Thanks

 

(defun c:BB ( / oldos ent1 p1)
 (setq oldos (getvar "osmode"))
 (while (setq ent1 (entsel "\nSelect object to break...    "))
        (initget 1)
        (setq p1 (getpoint "\nPoint at which to break...    "))
        (setvar "osmode" 0)
        (command "_.BREAK" ent1 "_f" p1 "@" "")
        (setvar "osmode" oldos))
 (princ "\nBreak at Done")
 (princ))

Link to comment
Share on other sites

If you set via osnaps what you want then type osmode a number will appear that is current snap setting osmode 32 is INT

 

 

Ok. But Which part of the code do i insert in 32?

 

I tried

 

(defun c:BB ( / oldos ent1 p1)
 (setq oldos (getvar "osmode" [color=red][b]32[/b][/color]))
 (while (setq ent1 (entsel "\nSelect object to break...    "))
        (initget 1)
        (setq p1 (getpoint "\nPoint at which to break...    "))
        (setvar "osmode" 0)
        (command "_.BREAK" ent1 "_f" p1 "@" "")
        (setvar "osmode" oldos))
 (princ "\nBreak at Done")
 (princ))

 

But got this error

 

Command: bb ; error: too many arguments

 

I tried

 

(defun c:BB ( / oldos ent1 p1)
 (setq oldos (getvar "osmode"[color=red][/color]))
 (while (setq ent1 (entsel "\nSelect object to break...    "))
        (initget 1)
        (setq p1 (getpoint "\nPoint at which to break...    "))
        (setvar "osmode" [color=red][b]32[/b][/color])
        (command "_.BREAK" ent1 "_f" p1 "@" "")
        (setvar "osmode" oldos))
 (princ "\nBreak at Done")
 (princ))

 

The command can continue but INT snap do not appear.

Link to comment
Share on other sites

Try this .

 

(defun c:bb (/ oldos ent1 p1)
 (setq oldos (getvar "osmode"))
 (setvar "osmode" 32)
 (while (and (setq ent1 (entsel "\nSelect object to break...    "))
             (not (initget 1))
             (setq p1 (getpoint "\nPoint at which to break...    "))
             )
   (command "_.BREAK" ent1 "_f" p1 "@" "")
   )
 (setvar "osmode" oldos)
 (princ "\nBreak at Done")
 (princ)
 )

Link to comment
Share on other sites

Even better with
*^C^Cbreak _appint \@

all you need is a single pick on the line you want to break near an intersection.

 

Interesting. I did not think macro could do this. I would use it but when i tested it,carn't really explain it well, but on breaking multiple line seems not smooth, in particular selecting the line that was previously selected as a breaking line reference.

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