0 Members and 1 Guest are viewing this topic.
(setq *acad* (vlax-get-acad-object) *doc* (vla-get-activedocument *acad*) *DimStyles* (vla-get-dimstyles *doc*) NewDimStyle (vla-add *DimStyles* "TestDimStyle"))
(vlax-put-property NewDimStyle 'Arrowhead1Type 4); error: ActiveX Server returned the error: unknown name: ARROWHEADTYPE
(vlax-put-property NewDimStyle 'Arrowhead1Type acArrowArchTick); error: ActiveX Server returned the error: unknown name: ARROWHEADTYPE
(vlax-put-property NewDimStyle 'Arrowhead1Type "acArrowArchTick"); error: ActiveX Server returned the error: unknown name: ARROWHEADTYPE
(vlax-put-property NewDimStyle 'Arrowhead1Block "ArchTick"); error: ActiveX Server returned the error: unknown name: ARROWHEADBLOCK
IAcadDimRotated: AutoCAD Rotated Dimension Interface; Property values:;.... <snipped some other stuff>; AltUnitsFormat = 2; AltUnitsPrecision = 2; AltUnitsScale = 25.4; Application (RO) = #<VLA-OBJECT IAcadApplication 00d591b4>[color=red]; Arrowhead1Block = "ArchTick"; Arrowhead1Type = 4; Arrowhead2Block = "ArchTick"; Arrowhead2Type = 4[/color]
(defun c:standarddims (/ *acad* *doc* *dims* StandardDimList DimData *TextStyles* NewStyle) (setq *acad* (vlax-get-acad-object) *doc* (vla-get-activedocument *acad*) *dims* (vla-get-dimstyles *doc*) ) ;_ end setq (setq StandardDimList (list ;DimStyleName DIMTXSTY DIMFRAC DIMTIH DIMRND DIMTXT DIMTAD DIMSCALE DIMBLK DIMANNO '("DimStyle_1" "Standard" 0 1 0.125 0.1 1 1 "" "N") '("DimStyle_2" "Romans" 1 1 0.125 0.1 1 1 "" "Y") '("DimStyle_3" "Style_3" 2 1 1 0.1 1 1 "" "Y") '("DimStyle_4" "Style_4" 2 1 1 0.1 0 1 "Loop" "N") '("DimStyle_5" "Style_5" 2 1 1 0.125 1 48 "Slappy" "Y") '("DimStyle_6" "Style_6" 2 1 1 0.125 1 48 "_ArchTick" "Y")) ;_ end of list ) ;_ end setq StandardDimList (vla-setvariable *doc* "CMDECHO" 0) (vl-cmdf "-DIMSTYLE" "R" "Standard") (foreach DimData StandardDimList (vla-setvariable *doc* "DIMLUNIT" 4) ; setup standard settings first (vla-setvariable *doc* "DIMAUNIT" 0) (vla-setvariable *doc* "DIMZIN" 3) (vla-setvariable *doc* "DIMASZ" 0.0625) (vla-setvariable *doc* "DIMEXE" 0.0625) (vla-setvariable *doc* "DIMEXO" 0.0625) (vla-setvariable *doc* "DIMGAP" 0.03125) (if (not (tblsearch "Style" (nth 1 DimData))) (progn (princ "\nSpecified text style not found, creating it with default settings" ) ;_ end of princ (setq *TextStyles* (vla-get-textstyles *doc*) NewStyle (vla-add *TextStyles* (nth 1 DimData)) ) ;_ end of setq (vla-put-height NewStyle 0.0) (vla-put-width NewStyle 0.85) (vla-put-fontfile NewStyle "Romans.shx") (vlax-release-object *TextStyles*) ) ;_ end progn ) ;_ end if (vla-setvariable *doc* "DIMTXSTY" (nth 1 DimData)) (vla-setvariable *doc* "DIMFRAC" (nth 2 DimData)) (vla-setvariable *doc* "DIMTIH" (nth 3 DimData)) (vla-setvariable *doc* "DIMRND" (nth 4 DimData)) (vla-setvariable *doc* "DIMTXT" (nth 5 DimData)) (vla-setvariable *doc* "DIMTAD" (nth 6 DimData)) (vla-setvariable *doc* "DIMSCALE" (nth 7 DimData)) (if (not (member (strcase (nth 8 DimData)) '("" "_DOT" "_DOTSMALL" "_DOTBLANK" "_ORIGIN" "_ORIGIN2" "_OPEN" "_OPEN90" "_OPEN30" "_CLOSED" "_SMALL" "_NONE" "_OBLIQUE" "_BOXFILLED" "_BOXBLANK" "_CLOSEDBLANK" "_DATUMFILLED" "_DATUMBLANK" "_INTEGRAL" "_ARCHTICK" ) ) ;_ end member ) ;_ end not (progn (if (not (tblsearch "Block" (nth 8 DimData))) (progn (princ "\nCan't find specified block... searching.... ") (if (not (findfile (strcat (nth 8 DimData) ".dwg"))) (progn (princ "\nUnable to locate specified block, setting to default. " ) ;_ end of princ (vla-setvariable *doc* "DIMBLK" "") ) ;_ end progn (progn (vl-cmdf "-INSERT" (nth 8 DimData) "0,0" "" "" "") (vl-cmdf "-erase" (entlast)) (vla-setvariable *doc* "DIMBLK" (nth 8 DimData)) ) ;_ end progn ) ;_ end if ) ;_ end progn (vla-setvariable *doc* "DIMBLK" (nth 8 DimData)) ) ;_ end if ) ;_ end progn (vla-setvariable *doc* "DIMBLK" (nth 8 DimData)) ) ;_ end if (vla-copyfrom (vla-add *dims* (nth 0 DimData)) *doc*) (vl-cmdf "-DIMSTYLE" "AN" (nth 9 DimData) (nth 0 DimData) "Y" "R" "Standard" ) ;_ end of vl-cmdf ) ;_ end foreach (vla-setvariable *doc* "CMDECHO" 1) (vlax-release-object *dims*) (vlax-release-object *doc*) (vlax-release-object *acad*) (princ)) ;_ end defun c:standarddims