Hi all,
I was tought that if you build a lisp routeen that you want to have executed automaticaly (without usser input) to simply leave out the C: from the (defun C:EXAMPLE ()....
okay works fine in everyother case i have had now though i have a dimstyles command though when i apply the same teaching to this it dosnt respond at all???
could somebody assist?
;----------------------------------------------------- ;INSTIGATING COMMAND... ;----------------------------------------------------- (defun mySTYLEpeilmaatvoering () ;----------------------------------------------------- ;check for layer and create if missing... ;----------------------------------------------------- (if (= (tblsearch "layer" "Legend") nil) (command "layer" "make" "MAATVOERING" "color" "1" "" "lt" "continuous" "" "")) ;----------------------------------------------------- ;check for style and create if missing... ;----------------------------------------------------- (command "style" "de Mâr (regular)" "Gothic.TTF" "0" "1" "0" "n" "n") (if (not (tblsearch "DImstyle" "PEILMAATVOERING")) (progn(command "dimstyle" "S" "PEILMAATVOERING") (command "dim" "style" "de Mâr (regular)" "DIMADEC" 2 "DIMALT" 0 "DIMALTD" 0 "DIMALTF" 25.4000 "DIMALTRND" 0.0000 "DIMALTTD" 0 "DIMALTTZ" 0 "DIMALTU" 2 "DIMALTZ" 0 "DIMASZ" 2.0000 "DIMATFIT" 3 "DIMAUNIT" 0 "DIMAZIN" 0 "DIMBLK" "" "DIMBLK1" "Small" "DIMBLK2" "Oblique" "DIMCLRD" 1 "DIMCLRE" 1 "DIMCLRT" 3 "DIMDEC" 0 "DIMDLE" 0.0000 "DIMDLI" 0.0000 "DIMEXE" 0.0000 "DIMEXO" 0.0000 "DIMFRAC" 0 "DIMGAP" 1.0000 "DIMJUST" 4 "DIMLFAC" 1.0000 "DIMLIM" 0 "DIMLUNIT" 2 "DIMLWD" -2 "DIMLWE" -2 "DIMRND" 1.0000 "DIMSAH" 1 "DIMSCALE" 25.0000 "DIMSD1" 0 "DIMSD2" 0 "DIMSE1" 0 "DIMSE2" 0 "DIMSOXD" 0 "DIMTAD" 2 "DIMTIH" 0 "DIMTIX" 1 "DIMTM" 0.0000 "DIMTMOVE" 2 "DIMTOFL" 0 "DIMTOH" 0 "DIMTSZ" 0.0000 "DIMTVP" 0.0000 "DIMTXSTY" "de Mâr (regular)" "DIMTXT" 3.0000 "DIMFIT" 5 \e) (command "dimstyle" "S" "PEILMAATVOERING" "Y")))(graphscr)(princ) ;----------------------------------------------------- ;TERMINATING DEFUN ... ;----------------------------------------------------- )
Because of this is not a command but function
you can add autoloading it like this
I've added just 2 lines below:
{code}
;----------------------------------------------------- ;INSTIGATING COMMAND... ;----------------------------------------------------- (defun mySTYLEpeilmaatvoering () ;----------------------------------------------------- ;check for layer and create if missing... ;----------------------------------------------------- (if (= (tblsearch "layer" "Legend") nil) (command "layer" "make" "MAATVOERING" "color" "1" "" "lt" "continuous" "" "")) ;----------------------------------------------------- ;check for style and create if missing... ;----------------------------------------------------- (command "style" "de Mâr (regular)" "Gothic.TTF" "0" "1" "0" "n" "n") (if (not (tblsearch "DImstyle" "PEILMAATVOERING")) (progn(command "dimstyle" "S" "PEILMAATVOERING") (command "dim" "style" "de Mâr (regular)" "DIMADEC" 2 "DIMALT" 0 "DIMALTD" 0 "DIMALTF" 25.4000 "DIMALTRND" 0.0000 "DIMALTTD" 0 "DIMALTTZ" 0 "DIMALTU" 2 "DIMALTZ" 0 "DIMASZ" 2.0000 "DIMATFIT" 3 "DIMAUNIT" 0 "DIMAZIN" 0 "DIMBLK" "" "DIMBLK1" "Small" "DIMBLK2" "Oblique" "DIMCLRD" 1 "DIMCLRE" 1 "DIMCLRT" 3 "DIMDEC" 0 "DIMDLE" 0.0000 "DIMDLI" 0.0000 "DIMEXE" 0.0000 "DIMEXO" 0.0000 "DIMFRAC" 0 "DIMGAP" 1.0000 "DIMJUST" 4 "DIMLFAC" 1.0000 "DIMLIM" 0 "DIMLUNIT" 2 "DIMLWD" -2 "DIMLWE" -2 "DIMRND" 1.0000 "DIMSAH" 1 "DIMSCALE" 25.0000 "DIMSD1" 0 "DIMSD2" 0 "DIMSE1" 0 "DIMSE2" 0 "DIMSOXD" 0 "DIMTAD" 2 "DIMTIH" 0 "DIMTIX" 1 "DIMTM" 0.0000 "DIMTMOVE" 2 "DIMTOFL" 0 "DIMTOH" 0 "DIMTSZ" 0.0000 "DIMTVP" 0.0000 "DIMTXSTY" "de Mâr (regular)" "DIMTXT" 3.0000 "DIMFIT" 5 \e) (command "dimstyle" "S" "PEILMAATVOERING" "Y")))(graphscr)(princ) ;----------------------------------------------------- ;TERMINATING DEFUN ... ;----------------------------------------------------- )
(command "dimstyle" "S" "PEILMAATVOERING" "Y")))(graphscr)(princ)
;-----------------------------------------------------
;TERMINATING DEFUN ...
;-----------------------------------------------------
)
(mySTYLEpeilmaatvoering)
(princ)
{code}
Tested on A2009 OK
~'J'~