- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am building a lisp to run without any interaction by the user. Also to run in accoreconsole on a list of mutliple drawings.
The anonymous name of the dynamic block on paperspace changes with different sets of drawings. (e.g.*U23, *U22, *U21)
I don't understand why this occurs. Nor do I understand why I can't just select the block with it's name "PRELIM_DYN". But I am able to select it with only the anonymous name (as long as i change my code to for the specific name. Also if I try to use
(ssget "_X" '((0 . "INSERT") (2 . "`*U*,BLOCKNAME1")))
it selects other anonymous blocks in the drawing.
I am trying to change several things about this code.
1. to select the prelim_dyn block with it's effective name/s and delete all instances
2. sometimes the insert uses the bottom of the block and other times it uses the middle.
3. get a variable for the pdf output location
4. check that all layouts are existing
5. change the exportpdf command to export but need to select all layouts and export all to 1 pdf.
1st things first. #1 priority is to select the prelim_dyn Dynamic Block on all layouts and delete all instances of it.
This block only exists in paperspace (no modelspace insertions)
(defun c:rs (/ ss1)
(setq filedia "0")
(setq cmddia "0")
(setq origPath (strcat (getenv "ACAD") ";")
addPath (strcat "X:\\MYPROGRAMS\\PDF_Creator\\Resources;")
newPath (strcat origPath addPath))
;set new ACAD string
(setenv "ACAD" newPath)
(setq NEWFILE (strcat (getvar "dwgprefix") "COMPLETE\\" (vl-filename-base (getvar "dwgname")) "_S"))
(setvar "ctab" "WELLSITE")
(if (setq ss (ssget "_x"
(list '(0 . "INSERT")
'(2 . "`*U21"))))
(command "._erase" ss "")
(prompt "\n** No blocks found ** "))
(command "._insert" "*SEAL" "6.74,2.94,0" "1" "0")
(setq ss nil)
(setvar "ctab" "SITE")
(if (setq ss (ssget "_x"
(list '(0 . "INSERT")
'(2 . "`*U21"))))
(command "._erase" ss "")
(prompt "\n** No blocks found ** "))
(command "._insert" "*SEAL" "1.94,2.59,0" "1" "0")
(setq ss nil)
(setvar "ctab" "C-SITE")
(command "._insert" "*SEAL" "7.05,0.92,0" "1" "0")
(command "-purge" "B" "`*U21,PRELIM_DYN" "N")
(command "_saveas" "" NEWFILE)
(command "EXPORTPDF" "")
(setvar "ctab" "C-SITE")
(command "_plot" "" "" "" "" "" "" "")
(command "_qsave")
(command "_close")
(setq filedia "1")
(setq cmddia "1")
(princ)
)
Solved! Go to Solution.