Jump to content

Recommended Posts

Posted

(setq tileset(ssadd));;create a selection set
(command "divide"ent2 "B" "TILE" "Y" 300 ); block name is TILE
 (setq ent3 (entlast));entity tiles
 (setq tileset(ssadd ent3 tileset));adding entity to selection set
 (command "mirror" tileset""p1 p2"Y");mirrered

I try to divide a line by a block named "TILE"

and I need to that all blocks add to a selection set and mirror around points p1,p2.

How can I add all blocks on that line to a selection set.

Posted

Sample code

(defun c:sample  (/ ent2 ent3 en p1 p2)
     (setq ent2 (car (entsel))
          p1 (getpoint "\nPick first point:")
          p2 (getpoint p1 "\nPick next point:"))
     (setq tileset (ssadd))
[color=blue]      (setq ent3 (entlast))[/color];<--- before divide 
     (command "divide" ent2 "B" "TILE" "Y" 300 ) 
   [color=blue]  (if (setq en (entnext ent3))
           (while en
                 (ssadd en tileset)
                 (setq en (entnext en)
                       )
                 )
           )
[/color]      (command "mirror" tileset "" p1 p2 "Y")
(princ)
     )

Posted
Thanks it works

 

Good for you.

 

Cheers :)

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