Jump to content

Insert Blocks Then Join All of Them


Bill Tillman

Recommended Posts

I'm inserting some blocks in a drawing and would like to JOIN them together so I can do things like copy, mirror, etc.. with the complete set of them. Okay, so block #1 goes in and then block #2 goes in and it's located directly adjacent to block #1, in fact the very top of the lines in block #1 butt right up against the very bottom lines in block #2 and block #2 gets inserted multiple times depending on the size of the panel then block #1 gets mirrored using the center of this assembly as it's mirror line.

 

When all is done I need some way of joining all of these block instances into a single entity. I tried JOIN but even when I use the JOIN command manually it allows me to select them but it won't join them together. I guess I could use a selection set. Is there a method to add these items into a selection set as this repeat loop happens? I;kk need the set to contain both copies of block #1 and all copies of block #2.

(command "._INSERT" "Block1"
   (polar (polar rg4 a90 enddim) 0 bearingbarthk) "" "" "")
 (setq pl1 (entlast)
count 0
)
 (repeat (- riveta 2)
   (command "._INSERT" "Block2"
     (polar (polar rg4 a90 (+ crimpbarbay bandingthk enddim (/ remspace 2.) (* crimpbarbay count 2))) 0 (- bearingbaroc crimpbarthk)) "" "" "")
   (setq count (1+ count))
   ); end repeat
 (command "._MIRROR" pl1 "" (polar rg4 a90 (/ (distance rg1 rg4) 2.)) "@2<180" "")

Link to comment
Share on other sites

Aha, I didn't think about using Group....and as my auto mechanics teacher from long ago used to reply to that response, "What were the first three words you said?"

 

Gotta break for a meeting but I'll be back on this later.

Link to comment
Share on other sites

GROUPS ??? I have to confess I haven't worked with them very much. And the first thing I found out is that when you type "GROUP" on the command line you don't get the same dialog when you run

(command "GROUP" ....).

in LISP. Okay so I figured out that I can group all the items I created with the repeat loop using the manual process, however I'm stumped on how to do it with LISP. The other examples I find say to do something like this

(command "._GROUP" "c" "*" "Reticuline" (polar (polar rg1 0 3) a270 9) (polar (polar rg4 0 4) a90 5) "" )

This exits cleanly, no errors messages or anything, yet it fails to group the items that would normally be selected by selecting those polar coordinates. I had it draw the rectangle for me and it definitely crosses over the items I want from right to left which should do it.

Link to comment
Share on other sites

Thanks tombu. I was just relogging in to reply that I had resolved this using ssget. I can't say it's the cleanest or most efficient method of doing this but for now at least it works.

 

sssetfirst....that's a new one for me. I'm reading up about it now.

Link to comment
Share on other sites

You can also put all of the items into a new block definition. The best method really depends on what all you are trying to accomplish. If you are only working with them in the AutoLISP routine, then you would just need them in a selection set, which can be handled using ssadd; but you probably already knew that.

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