delta Posted 9 hours ago Posted 9 hours ago Infil Panels-Layout1.pdfInfil Panels-Layout1.pdfInfil Panels-Layout1.pdfInfil Panels-Layout1.pdfInfil Panels-Layout1.pdfInfil Panels-Layout1.pdfHi All. I'm after some help with this pleasae. I want to insert 4 blocks into my drawing to form a square shape. The original 4 entities that I made are polylines and are saved as blocks in one drawing called BLOCKS_1. I start a new drawing and insert BLOCKS_1 into my drawing. This then makes the 4 polyline blocks available in my current drawing. I am then inserting the 4 blocks each at their relative 0,0,0 point which arranges the blocks how I want them. Heres where I cant get the join command to work. (I can manually join the 4 entities together using the JOIN command) After inserting the 4 blocks I am exploding them so they are now polylines and their end points are touching to form a square. this is an example of the code to only insert and explode 1 of the entities. I repeat this insert 3 more times, and change the ENTLAST to Ent2 Ent3 Ent4 (command "-insert" "Infil_HL" (0.0 0.0 0.0) "" "" "") ;Infil_HL is the block name one of the 4 entities thast are present in the drawing (setq Ent1 (entlast)) (command "_explode" Ent1) now when I run the join command it won't join the 4 entities into one. (command "_join" Ent1 Ent2 Ent3 Ent4) Regards Tony Quote
mhupp Posted 9 hours ago Posted 9 hours ago (edited) little background on how DWG drawings work or how I understand. When you create or modify anything in a drawing it puts it at the end of drawing list. that is why you can select the last thing with (entlast) The blocks you are inserting is a made up of entity's and when you explode the block its gone but it's entity's are left in the drawing. even if its only one item its now under a different entity name. Your join command is saying join block 1 2 3 4 but you exploded them. you have to build another selection set of those entity's to join. so you create a place holder in the Drawing list with LastEnt insert and explode your block. then with the while its basically saying anything after this point in the list add to selection set SS. then pass the SS to the join command. (setq SS (ssadd)) (setq LastEnt (entlast)) (command "-insert" "*Infil_HL" '(0.0 0.0 0.0) "" "" "") (command "-insert" "*blk2" '(0.0 0.0 0.0) "" "" "") ;ent2 (command "-insert" "*blk3 '(0.0 0.0 0.0) "" "" "") ;ent3 (command "-insert" "*blk4" '(0.0 0.0 0.0) "" "" "") ;ent4 (while (setq LastEnt (entnext LastEnt)) (ssadd LastEnt SS) ) (command "_join" SS) -edit adding * infront of the block name AutoCAD inserts and immediately explodes it in one step. Edited 8 hours ago by mhupp 2 1 Quote
Steven P Posted 4 hours ago Posted 4 hours ago 5 hours ago, mhupp said: adding * infront of the block name AutoCAD inserts and immediately explodes it in one step. I didn't know that 1 Quote
SLW210 Posted 2 hours ago Posted 2 hours ago Good stuff @mhupp! OP, why not just draw the polylines with LISP? 1 Quote
mhupp Posted 21 minutes ago Posted 21 minutes ago @Steven P I used it mostly for inserting text in blocks that need to be specific fonts, spacing, layers , and color. a side note even tho the blocks are exploded they are in the block library until you purge. keep that in mind when using generic block names. pasting a block from a different drawing will pull from the block library instead if they have the same name not the clipboard. So if block1 is a circle in DrawingA and a square in DrawingB. Selecting the block in drawingA and copy paste into DrawingB when it paste all the blocks will be squares. not the circles you copied. 1 Quote
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.