91
CAD General / Re: CONTINUOUS line type name in various localizations of AutoCAD
« Last post by ronjonp on May 09, 2024, 11:11:11 AM »If this is for code, use "_Continuous" and it should not matter.
There is nothing special in the drawing file or template.
My starting point is an example in the ActiveX section in HELP showed below.
I have no idea to redefine the "oML" in my case by given a title block "BLK-01" and an attribute "ATT-01" based on multi page drawing.
I'd like to learn this method.
Thanks.Code: [Select](defun c:Example_TextManipulation()
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Define the leader points
(setq points (vlax-make-safearray vlax-vbDouble '(0 . 14)))
(vlax-safearray-fill points '(1 1 0
1 2 0
2 2 0
3 2 0
4 4 0
)
)
(setq i 0)
(setq modelSpace (vla-get-ModelSpace doc))
(setq oML (vla-AddMLeader modelSpace points i))
(vla-put-TextWidth oML 7.4)
)
(defun c:PN2PV (/ add ss i e l d g lst s n alignEnt alignObj startSta endSta)
(setq add (ssadd))
(princ "\nSelect Alignment: ")
(if (setq ss (ssget '((0 . "AECC_ALIGNMENT"))))
(progn
;; If selection set is not empty
(repeat (setq i (sslength ss))
(setq e (ssname ss (setq i (1- i)))
l (vlax-curve-getdistatpoint e (vlax-curve-getendpoint e))
d (/ l 300.)
g d
lst nil)
(repeat 300
(setq lst (cons (vlax-curve-getpointatdist e g) lst)
g (+ g d)))
(setq lst (append lst (list (vlax-curve-getstartpoint e))))
(if (setq s (ssget "_F" lst '((0 . "AECC_STRUCTURE,AECC_PIPE,AECC_PRESSUREPIPE,AECC_FITTING,AECC_APPURTENANCE"))))
(repeat (setq n (sslength s))
(ssadd (ssname s (setq n (1- n))) add))))
(sssetfirst nil add)
(command "AddNetworkPartsToProf"))
(if (setq s (ssget "_F" lst '((0 . "AECC_STRUCTURE,AECC_PIPE,AECC_PRESSUREPIPE,AECC_FITTING,AECC_APPURTENANCE"))))
(repeat (setq n (sslength s))
(ssadd (ssname s (setq n (1- n))) add))))
(sssetfirst nil add)
(command "AddPressurePartsToProf"))
(princ "\nNo entities selected."))
(princ))
(defun c:Example_TextManipulation()
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Define the leader points
(setq points (vlax-make-safearray vlax-vbDouble '(0 . 14)))
(vlax-safearray-fill points '(1 1 0
1 2 0
2 2 0
3 2 0
4 4 0
)
)
(setq i 0)
(setq modelSpace (vla-get-ModelSpace doc))
(setq oML (vla-AddMLeader modelSpace points i))
(vla-put-TextWidth oML 7.4)
)