Jump to content

Quickly Create Block per drawing file


benzson11

Recommended Posts

Hi Everyone,

 

I'm trying to create a lisp routine that will create a block of all the objects inside a file and name the block same with the drawing file name.
I have manage to do this. But I have encountered some problem.
1st. My lisp won't continue so I add a save and close in the routine.
2nd. I need to add an conditional function that will explode if there is a block found and continue if none is found.

Any suggestion on how I will approach this problem and or improve my lisp routine.

I attach the lisp routien and sample drawing file.

QB-BENZSON.LSP R3-1(A).dwg

Link to comment
Share on other sites

Not a good practice to get into blocking a whole dwg. I have had dwg's submitted and took a while to find but had a complete other dwg saved as a block but not used so bloated the dwg.

 

If you save a dwg you can Insert it into another dwg this would be a better way are you trying to do some form of I want these objects in a new dwg, is not a DWT template dwg for that task ?

 

 

  • Like 2
Link to comment
Share on other sites

Hi Bigal thank you for your response. I just need to create the 3d solids with circle reference as block. I will use it on the dynamo script that I'm working on. It wont insert 3d solid but will insert blocks inside the drawings.

Link to comment
Share on other sites

Hey guys. @benzson11 don´t use "_A" in (setq selectionset (ssget "_A" '((0 . "3DSOLID,*SURFACE,CIRCLE")))) use "x" (setq selectionset (ssget "x" '((0 . "3DSOLID,*SURFACE,CIRCLE"))))

"All" or "al" is used in (command ".erase" "all" "") for example. In the ssget function to select everything "x" is used. I changed the purge command too.

I changed your file, test if that's how you wanted it.
Sorry my english from google translator. Because I don't speak English.

 

QB-BENZSON - new.LSP

  • Like 1
Link to comment
Share on other sites

  • CADTutor changed the title to Quickly Create Block per drawing file

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