Jump to content

Recommended Posts

Posted

I would greatly appreciate help on creating a lisp that would do the following:

1. call the bpoly command

probably (command "-bpoly")

2. wait for me to make all necessary clicks and create needed polylines till I exit the command

probably this should work (found on another thread)

(while (= 1 (getvar "cmdactive"))

(command pause))

3. add polylines created on step 2 to a new selection set

here I have no idea :)

 

Note that I also have other polylines in the drawing but I need in the selection set only the ones that were created on step 2 above.

Thanks in advance!

Posted

see ssadd for adding polylines to a selection set

Posted (edited)

@Steven P

Thanks for the reply, I made this new topic because I think it summarizes better what the need is. Basically, what I miss is creating the selection set with the new polylines, the rest of the lisp that writes the areas will remain the same. I will check the idea in the older thread and then I will delete it.

Edited by Radu Iordache
Posted

(setq el (entlast))

(setq ss (ssadd))

... DO PICKING WITH BPOLY ...

FINISHED... (exit while loop)

(while (setq el (entnext el))

  (ssadd el ss)

)

(sssetfirst nil ss) ;;; your selection set with newly created polylines/regions highlighted...

  • Like 1
Posted
20 hours ago, marko_ribar said:

(setq el (entlast))

(setq ss (ssadd))

... DO PICKING WITH BPOLY ...

FINISHED... (exit while loop)

(while (setq el (entnext el))

  (ssadd el ss)

)

(sssetfirst nil ss) ;;; your selection set with newly created polylines/regions highlighted...

Worked like magic! Thank you very much!

Posted

watch for when the (entlast) entity is a polyline or block with attributes then entnext selects the subentity. This utility avoids that problem

;;; posted by roy_043
;;; http://www.theswamp.org/index.php?topic=35626.msg408522#msg408522
(defun kg:GetLast ( / ent newEnt)
  (setq ent (entlast))
  (while (setq newEnt (entnext ent))
    (setq ent newEnt)
  )
  ent
)

 

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