SLW210 Posted February 18, 2016 Share Posted February 18, 2016 There is an Express Tool DimStyle Import (_.dimim), also. Used with DimStyle Export (_.dimex). Quote Link to comment Share on other sites More sharing options...
ksperopoulos Posted February 18, 2016 Author Share Posted February 18, 2016 Unless I missed it, what is the opposition to just creating it using plain autolisp?Just curious. I am still learning and I like to see what my options are. I am borderline OCD, so I like my code to look the same as much as possible. Like I mentioned before, I think it is easier to read for me to see what I have done (especially for a novice like me). Quote Link to comment Share on other sites More sharing options...
ksperopoulos Posted February 18, 2016 Author Share Posted February 18, 2016 To throw another option into the mix, you could also import the Dimension Style from a template/supporting drawing using ObjectDBX - no configuration necessary. I actually thought of doing that Lee, but I wanted to stay with something a little more "basic" for me. I'm sure getting something from another file is not as complicated as I think, but I want to get the hang of working within the files first. Maybe later, I will venture outside. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted February 18, 2016 Share Posted February 18, 2016 I actually thought of doing that Lee, but I wanted to stay with something a little more "basic" for me. I'm sure getting something from another file is not as complicated as I think, but I want to get the hang of working within the files first. Maybe later, I will venture outside. ObjectDBX may be a cleaner approach, as you can control exactly which objects are imported (here is an existing solution if you wish to follow this route); but since you presumably have full control over the content of the template file, an even easier method would be to simply import the block definition of the template file (command "_.-insert" nil) and hence import the Dimension Style in the process, and then delete the block definition. Quote Link to comment Share on other sites More sharing options...
Costinbos77 Posted September 12, 2020 Share Posted September 12, 2020 (edited) Hi, following the above codes as : (if (tblSearch "DimStyle" n) (prinC (strCat "\n Dimension Style '" n "' , Already EXIST ;")) (progn (prinC (strCat "\n Define NEW Dimension Style : '" n "' ;")) (or ActDoc (setq ActDoc (vla-Get-ActiveDocument (vlax-Get-Acad-Object)) ) ) ; or (setq dimC (vla-Get-DimStyles ActDoc)) (setq dS (vla-Add (vla-Get-DimStyles (vla-Get-ActiveDocument (vlax-Get-Acad-Object))) n)) (vla-Put-ActiveDimStyle ActDoc dS) ;;; (vla-SetVariable ActDoc "Variable" "VariableValue") (forEach e (list (list "DimAdec" zU) ; 4 (list "DimAlt" 0) (list "DimAltD" 2) (list "DimAltF" 25.4) (list "DimAltRnd" 0.) (list "DimAltTD" 2) (list "DimAltTZ" 0) (list "DimAltU" 2) (list "DimAltZ" 0) ; read-only - DIMANNO 0 (list "DimApost" "") (list "DimARCSYM" 0) (list "DimAssoc" 2) (list "DimASZ" 0.18) (list "DimATFIT" 3) (list "DimAunit" 0) (list "DimAzin" 0) (list "DimBlk" b) ; "Oblique" "ArchTick" (list "DimBlk1" "") (list "DimBlk2" "") (list "DimCEN" 0.09) (list "DimClrD" cD) ; Culoare Linii Dimension (list "DimClrE" cE) ; Culoare Linii Extensii (list "DimClrT" cT) ; Culoare Text 0-256 (list "DimConstraintIcon" 3) (list "DimContinueMode" 1) (list "DimDec" zD) ; 3 (list "DimDLE" 0.) (list "DimDLI" 0.38) ;;; (list "DimDsep" '(0. 0.)) (list "DimExe" 0.18) (list "DimExo" 0.0625) (list "DimFRAC" 0) (list "DimFXL" 1.) (list "DimFXLON" 0) (list "DimGAP" 0.09) (list "DimJOGANG" 0.7854) (list "DimJust" 0) (list "DimLAYER" ".") ; separator (list "DimLdrBlk" "") (list "DimLfac" sF) ; 1. (list "DimLim" 0) ;;; (list "DimLtex1" "") ;;; (list "DimLtex2" "") ;;; (list "DimLtype" "") (list "DimLunit" u) ; 2 = Decimal (list "DimLwd" -2) (list "DimLwe" -2) (list "DimPickBox" 5) (list "DimPost" (strCat p "<>" s)) (list "DimRnd" 0.) (list "DimSAH" 0) (list "DimScale" 1.) (list "DimSD1" 0) (list "DimSD2" 0) (list "DimSE1" 0) (list "DimSE2" 0) (list "DimSOXD" 0) ; read-only - DIMSTYLE "Standard" (list "DimTAD" 0) (list "DimTdec" 3) ; Toleranta Decimals (list "DimTfac" 1.) ; Toleranta SF (list "DimTfill" 0) (list "DimTfillCLR" 0) (list "DimTih" 0) (list "DimTix" 0) (list "DimTm" 0.) (list "DimTmove" 0) (list "DimTOFL" 0) (list "DimTOH" 0) (list "DimTOL" 0) (list "DimTOLJ" 1) (list "DimTP" 0.) (list "DimTSZ" 0.) (list "DimTVP" 0.) (list "DimTxSty" tS) ; "Standard" (list "DimTxt" h) ; 0.18 (list "DimTxtDirection" r) ; 0 (list "DimTxtRuler" 1) (list "DimTzin" 0) (list "DimUPT" 0) (list "DimZin" 0) ) (if (getVar (setq prop (car e))) (setVar prop (cadr e)) (prinC (strCat "\n UnAvailable Property Variable : '" prop "' ;")) ) ) ; f (vla-CopyFrom dS dimC) 1. What action can cose to disapear 'Standard' Dimension Style as in the below picture ? 2. 'Purge' command can remove it ? (command "_.-Purge" "_B" "*" "_N") Used separate , as a user Function how it is in this post , it is working fine , but , calling the Function in a program is removing the 'Standard' Dimension Style . 3. Why it is like that and How can be changed the description of the Dimension style 'Test1 + Angle precision = 0'? Regards , Costin Edited September 12, 2020 by Costinbos77 Quote Link to comment Share on other sites More sharing options...
Costinbos77 Posted September 12, 2020 Share Posted September 12, 2020 Hi , I find something very interesting about the 'Purge' command in releation with Dimension styles . So , in a NEW drawing , with NO entities , I copied and renamed the 'Standard' dimension style into 'Test1' and make it the current one . Writing from keyboard 'Purge' : the AutoCAD program is launching a dialog window : which cannot remove the "Standard" dimension style (which was not used / attached to an object and is not the current one ) . But , the command '-Purge' : (command "_.-Purge" "_A" "" "_N") can do it ! Hmm ... Regards, Costin 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.