Jump to content

end trim command


tricon77

Recommended Posts

I am trying to get this little script to end after the trim command.  The object for the entsel is a block.  Is there a way to insert the escape key?  I am going to build on top of this after it is solved.

The end goal is to select many blocks which are squares and the insertion point is in the center.  I want to trim the line which is under the insertion point of the block.

 

(progn

  (command "zoom"

                      "obj"

                      (setq ss (car (entsel)))

                      ""

                      "trim"

                      (cdr (assoc 10 (entget ss)))

))

Link to comment
Share on other sites

I tried to reproduce this script the way I thought it should run. I got the error "Cannot TRIM this object" because there was nothing to trim.

 

Either I don't understand what you're trying to do, or there's some key information missing.

 

How does the code know what to trim? How do you know the line passes through the insertion point? What does the escape key accomplish and where should it happen? Have you tried using two different command sequences? Have you tried running the script one line at a time in a drawing? Please help us to help you.

Link to comment
Share on other sites

(progn
  (command "zoom"
           "obj"
           (setq ss (car (entsel)))
           ""
           "trim"
           (cdr (assoc 10 (entget ss)))
))

 

I have add an attachment to help with the debugging.  The command above will prompt to pick an object.  You should pick the square block.  After picking the script zooms into the block. At this point, the pick is saved in variable ss.  the "trim" command is started and the pick point is the insertion point of the block.  (I am assuming the insert point is on the line) The line gets trim but stays in trim command. I would like to end the trim command and do a zoom previous.

 

Let me know if you need more info,

Thanks

demo.dwg

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