Jump to content

Modifying Lee Mac's Steal Command To insert Specific Blocks


Recommended Posts

Posted

Hi everyone, Firstly I would like to thank all the help I have received the past few months in my journey in learning Lisps and Macros.

So, I am creating a CUI that has buttons each button represent a block (e.g. Manhole, Street Lighting Column, Tactile Paving). All these blocks are saved individually in a folder (e.g. Manhole.dwg, Street Lighting.dwg etc). The CUI has a Macro 

*^C^C-insert;"LE-D-RWP";\;;;explode;last;-purge;Blocks;"LE-D-RWP";N;

The above above macro uses combination of insert command and purge to keep the drawing clean from the dwg block that it will bring in. Now while this method is good to bring the block in the drawing it is not very optimal when the block already exists in the drawing. Also, this can be a maintenance nightmare if you have 20+ Blocks (that means 20 dwgs that you will have to access and update something e.g. Layer color, name etc). 

Last week I found out that you can Setq within a CUI, so I had a lightbulb moment! The idea is this: I have one master dwg that will have all my blocks (easier to maintain and update) and will update the CUI to set the insertion block name global variable and then call a lisp that will import the block from the master dwg (Maybe something similar to Lee Mac Steal?).

So my question is the following, is there a simpler version of Lee Mac's Steal command that can access the blocks from the dwg? Lee Mac's steal lisp is over 1400 lines of code which will take a while to review and update.

;;CUI Macro
(setq Global_InsBlockName "Block1");(LOAD "STEALUPDATE");STEALUPDATE;

;;Modified Lee Mac Steal Lisp
;;From Drawing X
;;Import Global_InsBlockName

I believe this way I can have as many buttons for inserting blocks as I need by having only 1 dwg to insert from. Also it will make maintaining the CUI and Lisp code more manageable. 

What are your thoughts?

Posted (edited)

You could potentially use myo Import Block application, which is specifically targeting blocks.

Edited by Lee Mac

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