0 Members and 1 Guest are viewing this topic.
(defun C:ALE_Edit_StretchMleaders ( / Pnt001 Pnt002 Ss_Str) (if (and (setq Pnt001 (getpoint "\nSpecify first corner of Crossing Window (Start point of Stretch): ")) (setq Pnt002 (getcorner Pnt001 "\nSpecify opposite corner (Bricscad need a Window outside end point): ")) ) (if (setq Ss_Str (ssget "_C" Pnt001 Pnt002 '((0 . "MULTILEADER")))) (progn (princ "\nSecond point: ") (vl-cmdf "_.STRETCH" Ss_Str "" "_NONE" Pnt001 "\\")) (princ "\nNo Multileaders found in Crossing Window.") ) ) (princ))
Just thinking outloud, haven't written any code yet, but how about this idea?Enter commandSelect line to stretch using nEntselCreate a stretch window based on the boundary of the object, see Lee Mac's Bounding Box function: http://www.lee-mac.com/boundingbox.htmlFilter to only included the selected leaderStretch as applicable
( (-1 . <Nome entità: 7ff7bd02ef00>) (0 . "MULTILEADER") (5 . "70328") (102 . "{ACAD_REACTORS") (330 . <Nome entità: 7ff7bd02ef50>) (102 . "}") (330 . <Nome entità: 7ff7bd211820>) (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "$PRC_NORM") (100 . "AcDbMLeader") (270 . 2) (300 . "CONTEXT_DATA{") (40 . 25.0) (10 100253.0 -4310.54 0.0) (41 . 100.0) (140 . 100.0) (145 . 50.0) (174 . 1) (175 . 6) (176 . 0) (177 . 0) (290 . 0) (296 . 1) (341 . <Nome entità: 7ff7bd02ebe0>) (14 0.0 0.0 1.0) (15 100678.0 -4345.54 0.0) (16 25.0 25.0 25.0) (46 . 0.0) (93 . -1073741824) (47 . 25.0) (47 . 0.0) (47 . 0.0) (47 . 0.0) (47 . 0.0) (47 . 25.0) (47 . 0.0) (47 . 0.0) (47 . 0.0) (47 . 0.0) (47 . 25.0) (47 . 0.0) (47 . 0.0) (47 . 0.0) (47 . 0.0) (47 . 1.0) (110 100678.0 -4345.54 0.0) (111 1.0 0.0 0.0) (112 0.0 1.0 0.0) (297 . 0) (302 . "LEADER{") (290 . 1) (291 . 1) (10 101153.0 -4310.54 0.0) (11 -1.0 0.0 0.0) (90 . 0) (40 . 50.0) (304 . "LEADER_LINE{") (10 102568.0 -4770.16 0.0) (10 102568.0 -4310.54 0.0) (91 . 0) (170 . 1) (92 . -1056964608) (340 . <Nome entità: 0>) (171 . -2) (40 . 0.0) (341 . <Nome entità: 0>) (93 . 0) (305 . "}") (271 . 0) (303 . "}") (272 . 9) (273 . 9) (301 . "}") (340 . <Nome entità: 7ff7bd02ec80>) (90 . 6816768) (170 . 1) (91 . -1023410155) (341 . <Nome entità: 7ff7bd2119e0>) (171 . -2) (290 . 1) (291 . 1) (41 . 2.0) (342 . <Nome entità: 7ff7bd02c4a0>) (42 . 4.0) (172 . 1) (343 . <Nome entità: 7ff7bd2119c0>) (173 . 1) (95 . 6) (174 . 1) (175 . 0) (92 . -1056964608) (292 . 0) (344 . <Nome entità: 7ff7bd02ebe0>) (93 . -1056964608) (10 1.0 1.0 1.0) (43 . 0.0) (176 . 0) (293 . 0) (330 . <Nome entità: 7ff7bd02ec40>) (177 . 1) (44 . 0.0) (302 . "80401") (330 . <Nome entità: 7ff7bd02ec50>) (177 . 2) (44 . 0.0) (302 . "") (294 . 0) (178 . 0) (179 . 1) (45 . 25.0) (271 . 0) (272 . 9) (273 . 9) (295 . 1))
It is possible to get the coordinates, I have a command that liens up leaders, so it is possible, my code at: https://www.theswamp.org/index.php?topic=46576.msg516569#msg516569It has been a while since I have updated it, so I am sure there are bugs in the code at this point, but it should give you a jumping off point at least.
Comando: L2MTraccia all'indietro:[0.48] (VL-BT)[1.44] (ERRDUMP "tipo di argomento errato: numberp: nil")[2.39] (_call-err-hook #<SUBR @00000000374a9548 ERRDUMP> "tipo di argomento errato: numberp: nil")[3.33] (sys-error "tipo di argomento errato: numberp: nil"):ERROR-BREAK.28 nil[4.25] (+ nil 8)[5.19] (C:L2M)[6.15] (#<SUBR @0000000037705250 -rts_top->)[7.12] (#<SUBR @00000000030f8700 veval-str-body> "(C:L2M)" T #<FILE internal>):CALLBACK-ENTRY.6 (:CALLBACK-ENTRY):ARQ-SUBR-CALLBACK.3 (nil 0)Comando:Comando: ul** Error: tipo di argomento errato: numberp: nil **
Sorry, I was out on vacation, it looks like you are calling the L2M command, that is designed to convert lines and text to leaders, sorry I forgot there are multiple commands, look more at the UL command within that file.
How strange, it works ok on my system (English admittedly, but there shouldn't be anything language dependent).
(setq *path* (getvar "dwgprefix"))(setq pos (vl-string-position (ascii "\\") *Path* (+ (vl-string-position (ascii "\\") *path* 5) 1)))Comando: (setq *path* (getvar "dwgprefix"))"Z:\\Temp\\"Comando: (setq pos (vl-string-position (ascii "\\") *Path* (+ (vl-string-position (ascii "\\") *path* 5) 1)))nilpos is nil so in(If (or (= (strcase (substr *path* (+ pos 8) 1)) "C") (= (getvar "USERS5") "CIVIL"))(+ nil 8) > ** Error: tipo di argomento errato: numberp: nil **
(if (= pos nil)(setq pos 1))
(If (or (= (strcase (substr *path* (+ pos 8) 1)) "C") (= (getvar "USERS5") "CIVIL"))
(if (/= pos nil)(If (or (= (strcase (substr *path* (+ pos 8) 1)) "C") (= (getvar "USERS5") "CIVIL")))
Hmm, that would mean you don't have a \ in your drawing path? How is that possible?...
So, what would cause POS to be set to nil in that line then? It should set it to the position of the \What am I missing? Any ideas?