- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all!
I'm trying to create dimension styles with lisps. Now did it, but I'm trying to as a cond or if to it. I want o the lisp to check if the dim style is there and if not to add it. I'm trying to use (getvar "dimstyle) but it's not working.
What am I missing to add the condition with dimstyle?
Thank you!
here is my code.
(DEFUN C:TDIM1 () (SETQ STYLE (GETVAR "-DIMSTYLE") ) (cond ( ( EQUAL STYLE "Current dimension style: Standard") (C:TERRADIM1) ) ) (PRINC) ) (DEFUN C:TERRADIM1 () (SETVAR "CMDECHO" 0) (COMMAND "-DIMSTYLE" "ANNOTATIVE" "YES" "TERRA 0.1" "RESTORE" "TERRA 0.1" ) (SETVAR "DIMASZ" 0.1000 ) ;Arrow size (SETVAR "DIMCEN" 0.1000 ) ;Center mark size (SETVAR "DIMEXE" 0.1000 ) ;Extension above dimension line (SETVAR "DIMEXO" 0.1000 ) ;Extension line origin offset (SETVAR "DIMGAP" 0.1000 ) ;Gap from dimension line to text (SETVAR "DIMDLI" 0.1000 ) ;Dimension line spacing (SETVAR "DIMTXSTY" "TERRA 0.1" ) ;Text style (SETVAR "DIMFXL" 1.0000 ) ;Fixed Extension Line (SETVAR "DIMADEC" 0 ) ;Angular decimal places (SETVAR "DIMARCSYM" 0 ) ;Arc length symbol (SETVAR "DIMATFIT" 3 ) ;Arrow and text fit (SETVAR "DIMAUNIT" 0 ) ;Angular unit format (SETVAR "DIMAZIN" 0 ) ;Angular zero supression (SETVAR "DIMBLK" "." ) ;Arrow block name (SETVAR "DIMBLK1" "." ) ;First arrow block name (SETVAR "DIMBLK2" "." ) ;Second arrow block name (SETVAR "DIMCLRD" 256 ) ;Dimension line and leader color (SETVAR "DIMCLRE" 256 ) ;Extension line color (SETVAR "DIMCLRT" 256 ) ;Dimension text color (SETVAR "DIMDEC" 1 ) ;Decimal places (SETVAR "DIMDLE" 0.0000 ) ;Dimension line extension (SETVAR "DIMFRAC" 0 ) ;Fraction format (SETVAR "DIMFXLON" 0 ) ;Enable Fixed Extension Line ON/OFF (1/0) (SETVAR "DIMJUST" 0 ) ;Justification of text on dimension line (SETVAR "DIMLDRBLK" "." ) ;Leader block name (SETVAR "DIMLFAC" 1.0000 ) ;Linear unit scale factor (SETVAR "DIMLUNIT" 3 ) ;Linear unit format (SETVAR "DIMLWD" -2 ) ;Dimension line and leader lineweight (SETVAR "DIMLWE" -2 ) ;Extension line lineweight (SETVAR "DIMRND" 0.0000 ) ;Rounding value (SETVAR "DIMTAD" 1 ) ;Place text above the dimension line (SETVAR "DIMTDEC" 1 ) ;Tolerance decimal places (SETVAR "DIMTFAC" 1.0000 ) ;Tolerance text height scaling factor (SETVAR "DIMTFILL" 0 ) ;Text background enabled (SETVAR "DIMTFILLCLR" 256 ) ;Text background color (SETVAR "DIMTIH" 1 ) ;Text inside extensions is horizontal ON/OFF (1/0) (SETVAR "DIMTIX" 0 ) ;Place text inside extensions ON/OFF (1/0) (SETVAR "DIMTM" 0.0000 ) ;Minus tolerance (SETVAR "DIMTMOVE" 0 ) ;Text movement (COMMAND "-DIMSTYLE" "SAVE" "TERRA 0.1" "YES" ) (SETVAR "CMDECHO" 1) (PROMPT "\n CREATED GSG TERRA 0.1 DIMENSION STYLE") (PRINC) )
Solved! Go to Solution.
Link copied