Author Topic: Seek help ~~ Creating Multileader Style using LISP but Can't Work .....  (Read 1500 times)

0 Members and 1 Guest are viewing this topic.

KuoTze

  • Mosquito
  • Posts: 7
 :cry: :cry: :cry: :cry: :cry: :cry:

Need help ~~~~

I Want to Creating Multileader Style using LISP ... but can't put attrib block to Mleaderstyle ......

code : '("ContentBlockName" "_iDgnMK_5Z_MK材料標註") has a problem

the source block can't use  "_iDgnMK_5Z_MK材料標註" for my lisp
[img]
so I Need to find the right way

(defun make_mleader_style_MK   
                            (mleaderstylename

             /
             adoc
             mldrdict
             newldrstyle
             objcolor
            )
  (vl-load-com)
  (setq adoc (vla-get-activedocument (vlax-get-acad-object)))
  (setq   mldrdict (vla-item (vla-get-dictionaries adoc) "ACAD_MLEADERSTYLE"))
  (setq   newldrstyle (vlax-invoke mldrdict 'addobject mleaderstylename "AcDbMLeaderStyle" ))

  (foreach item
      (list
        '("AlignSpace"  4)
        '("ArrowSize" 1.25) 
        '("BitFlags"    0)
        '("BlockConnectionType" 1)
        '("BlockRotation" 0.0)
        '("BlockScale"    1.0)
        '("BreakSize"    1.25)
        
        '("ContentType"     1)
                
        '("BlockConnectionType"  1)
             '("ContentBlockType" 6)
        '("ContentBlockName" "_iDgnMK_5Z_MK材料標註")

        '("Description" "MK-Mleader Style Description")
        '("DoglegLength" 5.0)
        '("DrawLeaderOrderType" 0)
        '("DrawMLeaderOrderType" 1)
        '("EnableBlockRotation" -1)
        '("EnableBlockScale" -1)
        '("EnableDogleg" -1)
        '("EnableFrameText" 0)
        '("EnableLanding" -1)
        '("FirstSegmentAngleConstraint" 0)
        '("LandingGap" 0.9)           
        '("LeaderLineType" 1)
        '("LeaderLineTypeId" "CENTER2")
        '("LeaderLineWeight" -3)
        '("MaxLeaderSegmentsPoints" 2)
        '("ScaleFactor" 1.0)
        '("SecondSegmentAngleConstraint" 0)
        
        '("TextAlignmentType" 0)
        '("TextAngleType" 0)
        
        '("TextAttachmentDirection"   0)
        '("TextBottomAttachmentType"   0)
        '("TextHeight"   0.18)
        '("TextLeftAttachmentType"   1)
        '("TextRightAttachmentType"   1)
        '("TextTopAttachmentType"   0)
        
      )
    (vlax-put newldrstyle (car item) (cadr item))
  )
  newldrstyle
)





 
« Last Edit: December 22, 2016, 08:25:34 AM by KuoTze »

ChrisCarlson

  • Guest
Re: Seek help ~~ Creating Multileader Style using LISP but Can't Work .....
« Reply #1 on: December 22, 2016, 12:50:31 PM »
Looking at those properties, I think you are settings properties for an mleader entity, not an mleader style.

https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2015/ENU/AutoCAD-ActiveX/files/GUID-14AC2D0B-EBFC-44B9-982D-9112539F8DE8-htm.html

KuoTze

  • Mosquito
  • Posts: 7
Re: Seek help ~~ Creating Multileader Style using LISP but Can't Work .....
« Reply #2 on: December 23, 2016, 02:22:20 AM »
Thank you .....
I think I found the problem ....
fix code
'("Block" "_iDgnMK_5Z_MK材料標註")

Thank you ..... :2funny: