Bill Tillman Posted April 9, 2015 Share Posted April 9, 2015 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" "") Quote Link to comment Share on other sites More sharing options...
ReMark Posted April 9, 2015 Share Posted April 9, 2015 Why aren't you using GROUP? See attached drawing. There are three blocks (b1, b2 and b3) that act as one group. JoinTheGroup.dwg Quote Link to comment Share on other sites More sharing options...
Bill Tillman Posted April 9, 2015 Author Share Posted April 9, 2015 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. Quote Link to comment Share on other sites More sharing options...
Bill Tillman Posted April 9, 2015 Author Share Posted April 9, 2015 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. Quote Link to comment Share on other sites More sharing options...
tombu Posted April 9, 2015 Share Posted April 9, 2015 Try: (sssetfirst nil (ssget CP (polar (polar rg1 0 3) a270 9) (polar (polar rg4 0 4) a90 5)))(command "._GROUP" "c" "*" "")(princ) Quote Link to comment Share on other sites More sharing options...
Bill Tillman Posted April 9, 2015 Author Share Posted April 9, 2015 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. Quote Link to comment Share on other sites More sharing options...
ReMark Posted April 9, 2015 Share Posted April 9, 2015 Just remember where you heard about GROUP first! LoL Quote Link to comment Share on other sites More sharing options...
neophoible Posted April 10, 2015 Share Posted April 10, 2015 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.