用于创建多重引线Styl的LISP
....... 这是一个开始。。您需要找到所有要更改的属性并添加它们。(defun _makemleaderstyle (name txtstyle / d mld mlo)
;; RJP - 09.16.2017
(if
(and
(setq d (vla-get-dictionaries (vla-get-activedocument (vlax-get-acad-object))))
(= 'vla-object (type (setq mld (vl-catch-all-apply 'vla-item (list d "ACAD_MLEADERSTYLE")))))
(= 'vla-object
(type
(setq mlo (vl-catch-all-apply 'vlax-invoke (list mld 'addobject name "AcDbMLeaderStyle")))
)
)
)
(progn (vla-put-alignspace mlo 0.1)
(vla-put-annotative mlo :vlax-true)
(vla-put-arrowsize mlo 0.18)
(vla-put-blockconnectiontype mlo 0)
(vla-put-breaksize mlo 0.1)
(vla-put-description mlo "")
(vla-put-dogleglength mlo 0.125)
(vla-put-enablelanding mlo :vlax-true)
(vla-put-firstsegmentangleconstraint mlo 0)
(vla-put-landinggap mlo 0.05)
(vla-put-maxleadersegmentspoints mlo 2)
(vla-put-scalefactor mlo 1)
(vla-put-secondsegmentangleconstraint mlo 0)
(vlax-put mlo 'textalignmenttype 0)
(vlax-put mlo 'textleftattachmenttype 1)
(vlax-put mlo 'textrightattachmenttype 1)
(vla-put-textheight mlo 0.1)
;; Make sure you load your texstyle first or it will default to standard
(vla-put-textstyle
mlo
(if (tblobjname "style" txtstyle)
txtstyle
"standard"
)
)
mlo
)
)
)
;; (_makemleaderstyle "Bazinga!" "Standard")
(vl-load-com)
;; Properties below
; IAcadMLeaderStyle: AutoCAD MLeaderStyle Interface
; Property values:
; AlignSpace = 5.0
; Annotative = 0
; Application (RO) = #<VLA-OBJECT IAcadApplication 00007ff701d75188>
; ArrowSize = 0.18
; ArrowSymbol = ""
; BitFlags = 0
; Block = ""
; BlockColor = #<VLA-OBJECT IAcadAcCmColor 0000022367bcf870>
; BlockConnectionType = 0
; BlockRotation = 0.0
; BlockScale = 1.0
; BreakSize = 0.125
; ContentType = 2
; Description = ""
; Document (RO) = #<VLA-OBJECT IAcadDocument 0000022358e47788>
; DoglegLength = 2.0
; DrawLeaderOrderType = 0
; DrawMLeaderOrderType = 1
; EnableBlockRotation = -1
; EnableBlockScale = -1
; EnableDogleg = -1
; EnableFrameText = 0
; EnableLanding = -1
; FirstSegmentAngleConstraint = 0
; Handle (RO) = "2FA"
; HasExtensionDictionary (RO) = 0
; LandingGap = 0.4
; LeaderLineColor = #<VLA-OBJECT IAcadAcCmColor 0000022367bcf690>
; LeaderLinetype = 1
; LeaderLineTypeId = AutoCAD.Application: Null object ID
; LeaderLineWeight = -2
; MaxLeaderSegmentsPoints = 2
; Name = "test"
; ObjectID (RO) = 3212
; ObjectName (RO) = "AcDbMLeaderStyle"
; OverwritePropChanged (RO) = 0
; OwnerID (RO) = 2921
; ScaleFactor = 1.0
; SecondSegmentAngleConstraint = 0
; TextAlignmentType = 0
; TextAngleType = 0
; TextAttachmentDirection = 0
; TextBottomAttachmentType = 0
; TextColor = #<VLA-OBJECT IAcadAcCmColor 0000022367bcf6f0>
; TextHeight = 0.2
; TextLeftAttachmentType = 2
; TextRightAttachmentType = 3
; TextString = ""
; TextStyle = AutoCAD.Application: Null object ID
; TextTopAttachmentType = 0
; Methods supported:
; Delete ()
; GetExtensionDictionary ()
; GetXData (3)
; SetXData (2)
我不太明白你的意思。。。看起来你有列出的属性。。。此中缺少哪些属性?或者你是说我只需要把MLeader中的内容改成我想看到的内容? 当我运行它时,它会说“Error too less arguments”,第一个不应该有一个c别名吗?(defun _makemleaderstyle(名称txtstyle/d mld mlo) 该函数接受名称和textsyle(\u makemleaderstyle“Alpha”“Ascent”)。。我添加了一些属性,但您正在创建的样式可能需要更多属性。
IMO。。有一个包含所有样式的模板,然后从该模板开始,或者将其作为块插入,这要容易得多。
是的,我们有一个模板,并添加了我们的mleader风格。。。我想我们想要这样做的原因是,每当我们打开一个图形时,ascent mleaderstyle就会自动出现在图形中,并设置为当前。。。但我认为我们可以通过在模板中已有它来解决这个问题。。。 在启动时添加以下内容:
(command "_.insert" "fullpathtotemplate" nil)
(setvar 'cmleaderstyle "Alpha") 我想我想说的是,如果我们开始在外部公司绘图。
请参阅之前的回复。 看起来代码不起作用。。。执行时说无。
页:
[1]
2