So a while ago I discovered visibility settings within the block editor, and I was really intrigued with it since one of the most apparent uses of it is to effectively turn multiple blocks into one block with a drop down menu. I found the concept great for categorizing like parts that may change from start to finish, and it would be easier/cooler than having to delete and replace the block. In addition I’m a fan of LISPing tedious/repetitive work like utility drafting, inserting blocks, or dimensioning. It’s fairly basic as far as LISP goes/can go, basically just fancy macroing that actually works off of existing CAD commands. The way I've always set up my block insertion LISP routines is as such
Code:
(defun C:36FES()
(setq cancel *error*)
(setq *error* trapblocks)
(setq oldlayer (getvar "clayer"))
(command "-LAYER" "MAKE" "UP-ST-STRUCT" "COLOR" "242" "" "")
(command "-INSERT" "36IN-FES.dwg" PAUSE "1" "1" PAUSE)
(setvar "clayer" oldlayer)
(setq *error* temperr)
If you don't know LISP the two lines to really be concerned about (here) are the two command lines sandwiched between some trapping. All these two lines are doing are working off existing CAD commands to macro bringing in a drawing as a block on the correct layer with the correct color. This basic form of LISP has worked successfully with any simple drawing, but the moment I put in the visibility settings it breaks.
The thing is I always insert a drawing as a block, and this is where I'm struggling. I can't seem to import it into another drawing. I don't think it's an issue with LISP because I can't manually insert the drawing either. When I do I just get an arrow on the correct layer. It's like it doesn't know what to do about the visibility setting so it just breaks the block. I'm pretty sure I could create the block in a template and have it work successfully whenever a drawing starts with that template, but I'm not a fan of that simply because if the drawing isn't using the template (or is an older drawing) you can't use it anymore. I'd rather have it be its own separate drawing that gets inserted via the insert command.
Anyone have any ideas or am I misunderstanding how the block editor's functionality works in drawings outside of where the block was created/edited? I feel like this should be doable.
Thanks