Jump to content

Recommended Posts

Posted

Hi, I am trying to offset the entlast with option Through displaying the preview of the new polyline like the gift below, but I failed to display the new polyline, I tried command like: 

 

(command "_.offset" "_E" "_N" "_T" (entlast) pause)

 

The command work without the preview, anyone can help me with this issue?

 

source.gif

Posted (edited)

What happens if you change it to (command "_offset" "_E" "_N" "_T" (entlast) pause)?

Edited by dlanorh
Posted

Happens the same, no display the preview of new line 🙁

Posted

That is probably because the command via lisp cannot trigger the preview. Someone may have an idea on how to emulate it, but it is not available via lisp.

Posted

Perhaps use vla-sendcommand?:

(defun c:test ()
  (if (setq *entselLst* (entsel))
    (vla-sendcommand
      (vla-get-activedocument (vlax-get-acad-object))
      "_.offset _erase _no _through !*entselLst* "
    )
  )
  (princ)
)

 

  • Like 2
Posted

Roy tried with ( entsel) rather than !*entselst* worked in Briscad. Note though no error check then.

  • Thanks 1
  • 3 weeks later...
Posted

Hello again, one more question how I finish the command after 

(vla-get-activedocument (vlax-get-acad-object))
      "_.offset _erase _no _through !*entselLst* "
    )
  • 2 months later...
Posted

Hello, 

 

As I said in first I trying draw a polyline and after do a offset with through option.

After help of Roy_043 I do this:

 

(defun c:test()
(vl-load-com)
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(setq p1 (getpoint "\First point..."))
(setq p2 (getpoint p1 "\nSecond point..."))
(command "_pline" p1 p2)
(while (setq p2 (getpoint "\nNext point...(Enter to finish)...." p2))
(command p2)
)
(command)   
(vla-sendcommand obj "_.offset _erase _no _through (entlast) ")
)

 

But after I click to make a new polyline the lisp continues asking to select object to offset (I need the lisp finish here) and if I press ESC to cancel the command and hit ENTER to do the same command again the last command is the "offset" instead of test.

 

I think I am  doing this the worst way. If anyone can help me I will apreciatte so much

Posted (edited)

What you are seeing is a logical consequence of using vla-sendcommand. The command string is processed after the Lisp function has finished.

If you really need the preview then maybe a toolbar macro is an option?

Edited by Roy_043
  • Like 1
Posted
4 hours ago, Roy_043 said:

What you are seeing is a logical consequence of using vla-sendcommand. The command string is processed after the Lisp function has finished.

If you really need the preview then maybe a toolbar macro is an option?

 

I search about toolbar macro, if understood correct I will always need to click on button at toolbar that slowing down the process 🙁

Posted

You can create a keyboard shortcut for the macro.

  • Thanks 1

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