gadgetjay Posted July 1, 2015 Share Posted July 1, 2015 Hi All, I have created a ACAD.lsp to add 2 dimension styles every time I open a drawing. It works but opens a help page every time? any ideas what I have done wrong? Code: (command "._style" "ARIAL" "ARIAL.ttf" "0" "1" "" "" "" "") (command "DIMADEC" "0" ; Angular decimal places "DIMALT" "0" ; Alternate units selected "DIMALTD" "0" ; Alternate unit decimal places "DIMALTF" "3.2808" ; Alternate unit scale factor "DIMALTRND" "0" ; Alternate units rounding value "DIMALTTD" "0" ; Alternate tolerance decimal places "DIMALTTZ" "0" ; Alternate tolerance zero suppression "DIMALTU" "2" ; Alternate units "DIMALTZ" "0" ; Alternate unit zero suppression "DIMAPOST" "'" ; Prefix and suffix for alternate text "DIMASO" "On" "DIMASSOC" "2" "DIMASZ" "500" ; Arrow size "DIMATFIT" "3" ; Arrow and text fit "DIMAUNIT" "0" ; Angular unit format "DIMAZIN" "3" ; Angular zero supression "DIMBLK" "." ; Arrow block name "DIMBLK1" "." ; First arrow block name "DIMBLK2" "." ; Second arrow block name "DIMCEN" "-80" ; Center mark size "DIMCLRD" "1" ; Dimension line and leader color "DIMCLRE" "1" ; Extension line color "DIMCLRT" "1" ; Dimension text color "DIMDEC" "1" ; Decimal places "DIMDLE" "50" ; Dimension line extension "DIMDLI" "30" ; Dimension line spacing "DIMDSEP" "." ; Decimal separator "DIMEXE" "50" ; Extension above dimension line "DIMEXO" "50" ; Extension line origin offset "DIMFIT" "3" "DIMFRAC" "0" "DIMGAP" "50" ; Gap from dimension line to text "DIMJUST" "0" ; Justification of text on dimension line "DIMLDRBLK" "." ; Leader block name "DIMLFAC" "0.001" ; Linear unit scale factor "DIMLIM" "0" ; Generate dimension limits "DIMLUNIT" "2" ; Linear unit format "DIMLWD" "-2" ; Dimension line and leader lineweight "DIMLWE" "-2" ; Extension line lineweight "DIMPOST" "." ; Prefix and suffix for dimension text "DIMRND" "0.0" ; Rounding value "DIMSAH" "0" ; Separate arrow blocks "DIMSD1" "0" ; Suppress the first dimension line "DIMSD2" "0" ; Suppress the second dimension line "DIMSE1" "0" ; Suppress the first extension line "DIMSE2" "0" ; Suppress the second extension line "dimsho" "1" "DIMSOXD" "0" ; Suppress outside dimension lines "DIMTAD" "0" ; Place text above the dimension line "DIMTDEC" "1" ; Tolerance decimal places "DIMTFAC" "1" "DIMTIH" "1" ; Text inside extensions is horizontal "DIMTIX" "0" ; Place text inside extensions "DIMTM" "200" ; Minus tolerance "DIMTMOVE" "0" ; Text movement "DIMTOFL" "0" ; Force line inside extension lines "DIMTOH" "1" ; Text outside horizontal "DIMTOL" "0" ; Tolerance dimensioning "DIMTOLJ" "1" ; Tolerance vertical justification "DIMTP" "0" ; Plus tolerance "DIMTSZ" "0" ; Tick size "DIMTVP" "0" ; Text vertical position "DIMTXSTY" "ARIAL" ; Associated Text style "DIMTXT" "500" ; Text height "DIMTZIN" "0" ; Tolerance zero suppression "dimunit" "2" "DIMUPT" "0" ; User positioned text "DIMZIN" "12" ; Zero suppression "DIMFRAC" "0" ; Fraction format (0 is stacked 2 horiz) "DIMTFAC" "1" ; Tolerance text height scaling factor "DIMSCALE""1" "PSLTSCALE""0" "DIMSTYLE" "_S" "Aisle Dim" "_Y") (command "DIMASZ" "80" ; Arrow size "DIMAZIN" "2" ; Angular zero supression "DIMCEN" "0" ; Center mark size "DIMCLRT" "7" ; Dimension text color "DIMDEC" "2" ; Decimal places "DIMGAP" "0" ; Gap from dimension line to text "DIMSTYLE" "_S" "Stand Size" "_Y") (command "TEXTSIZE""500" );end command (princ) ;;;;; Thanks Quote Link to comment Share on other sites More sharing options...
rlx Posted July 1, 2015 Share Posted July 1, 2015 without lookin' at de code itself , this is typical for an extra enter ("") somewhere in your code Quote Link to comment Share on other sites More sharing options...
rlx Posted July 1, 2015 Share Posted July 1, 2015 without lookin' at de code itself , this is typical for an extra enter ("") somewhere in your code yip , your first line with the command has one enter to many gr. R. Quote Link to comment Share on other sites More sharing options...
gadgetjay Posted July 1, 2015 Author Share Posted July 1, 2015 Perfect - Many Thanks Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 2, 2015 Share Posted July 2, 2015 Perhaps a better practice is to use setvar rather than command but you will need to do it for every line. Better still why not just create a dimension style in your template dwg. At worst insert from another dwg. Quote Link to comment Share on other sites More sharing options...
gadgetjay Posted July 2, 2015 Author Share Posted July 2, 2015 I done it that way as i just edited an exported dim style(s). I prefer to load these directly in the drawings i receive automatically rather than keep having to insert them. i'm having to go through all my scripts at the moment as my IT department decide to upgrade my CAD from 2010 to 2011 - which is now causing a few to give an " error: exceeded maximum number of selection sets" .. Fun Fun Fun! Quote Link to comment Share on other sites More sharing options...
tombu Posted July 2, 2015 Share Posted July 2, 2015 Modifying every drawing every time it's opened seems harsh. Why not use something like (tblsearch "DIMSTYLE" "Aisle Dim") to see if the style is already in the drawing before adding it? There are a number of settings that are only modified as needed in my acaddoc.lsp. With good templates that only happens with outside drawings. Inserting a template with whatever text, dimension, ect… styles and layers you use would seem easier. I'd never use a command call in acaddoc.lsp, there's better ways to go. Always using localized variables to store selection sets in your lisp should avoid those errors although many AutoCAD commands add to the list of selection sets. LAYISO & MATCHPROP being the worst. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.