A better block insert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need help once again. I have a lisp routine to insert a dynamic block into a drawing. This dynamic block contains mtext with stacked fractions. Every now and then, the drawing will "lose" the fractions. I think it may be the drawing containing the block gets inserted as a block and now I have two blocks referencing the same thing. Is there a better way to insert/reference this block? I want to keep it as an independent file so I can insert it into any drawing, so saving the block in my main file will not be a viable option. Can utilizing layerstates be having some effect on this block. I do have multiple layers in the block. Here is my code for this operation and I have also included a copy of my block:
(defun c:sc1 (/ temperr *error* oldos oldor oldlayer p1 col) ; this starts the routine
(setq temperr *error*) ; saves *error*
(setq *error* myerr) ; sets the new error variable
(command-s "_.undo" "_mark") ; start of "undo" command
(graphscr)
(setvar "cmdecho" 0)
(setq oldos (getvar "osmode")) ; saves the current osnap settings
(setvar "osmode" 0) ; sets new osnap settings
(setq oldor (getvar "orthomode")) ; saves the current ortho setting
(setvar "orthomode" 1) ; turns the ortho on
(setq oldlayer (getvar "clayer")) ; saves the current layer
(command "_.-layer" "_set" "1ST_FL_NOTES" "") ; updates the current layer
(setq p1 (getpoint "\nSelect column location ")) ; asks user to select a point
(command "_.-insert" "1st hss col" p1 "" "" "") ; inserts col block
(setq col (entlast)) ; ties the block to the 'col' variable
(command "_.burst" col) ; burst the block
(setvar "osmode" oldos) ; sets the osnaps to previous settings
(setvar "orthomode" oldor) ; restores the ortho to previous setting
(setvar "clayer" oldlayer) ; sets the current layer to previous setting
(setq *error* temperr) ; restores original error
(princ)
) ; ends the command
This is a screen capture of what it looks like vs. what it should look like.
Any help would be appreciated because I hate doing the same thing multiple times.