[CHECKING TEXT <Untitled-2> loading... SELECTION]
.
; === Top statistic:
; Global variables: (DADWID)
.
; === Top statistic:
; Global variables: (DADDEP)
.
; === Top statistic:
; Global variables: (ANG DADDEP DADWID DANSWER DANSWER2 DEST DQUESTION ECHOVAR GR LEADERSET LOOP ORIG RD X XD Y YD)
; Function definition (with number of arguments): ((C:DADO . 0))
.
; === Top statistic:
; Global variables: (ORIG)
; Function definition (with number of arguments): ((HORIZONTAL . 0))
.
; === Top statistic:
; Global variables: (ORIG)
; Function definition (with number of arguments): ((VERTICAL . 0))
.
; === Top statistic:
; Global variables: (X XD)
; Function definition (with number of arguments): ((XM . 1))
.
; === Top statistic:
; Global variables: (Y YD)
; Function definition (with number of arguments): ((YM . 1))
.
; === Top statistic:
; Global variables: (ANG GR ORIG PPT REALANG XD YD)
; Function definition (with number of arguments): ((PREVIEW . 0))
; Check done.
Selects the last visible object added to the drawing database.
Caution: when using the "L" selection method in an MDI environment, you cannot always count on the last object drawn to remain visible. For example, if your application draws a line, and the user subsequently minimizes or cascades the AutoCAD drawing window, the line may no longer be visible. If this occurs, ssget with the "L" option will return nil.
;; Rune Wold and Michael Puckett - modified ale_lastent ale_ss-after
(defun ale_lastent (/ entnam outval)
(and
(setq outval (entlast))
(while (setq entnam (entnext outval))
(setq outval entnam)
)
)
outval
)
(defun ale_ss-after (entnam / entnxt selset)
(cond
((not entnam) (ssget "_X"))
((setq entnxt (entnext entnam))
(setq selset (ssadd entnxt))
(while (setq entnxt (entnext entnxt))
(if (entget entnxt)
(ssadd entnxt selset)
)
)
selset
)
)
; Function: ALE_LastEnt - original by Rune Wold and Michael Puckett (lastent)
;
; Version 1.01 - 20/12/2004 - modified with (and ...)
;
; Description:
; get the absolute last entity in the database,
; for problems in >=r15 in blocks with attrib, and polylines
;
; Arguments: none
;
; Return Values:
; An entity name;
; otherwise nil, if there are no entities in the current drawing
;
; Example: (setq marker (ALE_LastEnt)) see ALE_Ss-After
;
(defun ALE_LastEnt ( / EntNam OutVal)
(and
(setq OutVal (entlast))
(while (setq EntNam (entnext OutVal))
(setq OutVal EntNam)
)
)
OutVal
)
;
; Marc'Antonio Alessi
; Function: ALE_Ss-After thanks to Michael Puckett (Ss-After)
;
; Version 1.01 - 20/12/2004 for empty DWG
; Version 1.02 - 30/09/2005
; Version 1.03 - 06/05/2010 to support Bricscad
;
; Description:
; get a selection set of items after EntNam in the database
;
; Arguments: An entity name
;
; Return Values:
; A selection set;
; otherwise nil, if there are no entities after EntNam
;
; Examples:
; (setq marker (ALE_LASTENT)) ...create new entities...
; to include reference entity:
; (command "_.MOVE" (ALE_SS-AFTER marker) marker "" ...)
; Note: NOT valid if marker is a SEQEND of
; blocks with attrib or old polylines (PLINETYPE = 0)
;
; not include reference entity:
; (command "_.MOVE" (ALE_SS-AFTER marker) "" ...)
;
(defun ALE_Ss-After (EntNam / SelSet)
(cond
( (not EntNam) (ssget "_X" '((0 . "~VIEWPORT"))) ); "~VIEWPORT" x Bricscad
( (setq EntNam (entnext EntNam))
(setq SelSet (ssadd EntNam))
(while (setq EntNam (entnext EntNam))
(if (entget EntNam) (ssadd EntNam SelSet))
)
SelSet
)
)
)
;THIS SECTION IS WHERE THE GLITCH HAPPENS
(command "leader"
orig
(list (xm 2) (ym 2))
""
(setq leaderset (ssget "_L")) ;Start selection set, grabbing multileader line just created - ERROR OCCURS HERE FOR SOME USERS, NO ERROR FOR OTHERS
""
(strcat daddep "\"D x " dadwid "\"W Dado")
""
)
(setq leaderset (ssadd (entlast) leaderset)) ;Adds the text to the selection set
; Function: ALE_LastEnt - original by Rune Wold and Michael Puckett (lastent)
;
; Version 1.01 - 20/12/2004 - modified with (and ...)
;
; Description:
; get the absolute last entity in the database,
; for problems in >=r15 in blocks with attrib, and polylines
;
; Arguments: none
;
; Return Values:
; An entity name;
; otherwise nil, if there are no entities in the current drawing
;
; Example: (setq marker (ALE_LastEnt)) see ALE_Ss-After
;
(defun ALE_LastEnt ( / EntNam OutVal)
(and
(setq OutVal (entlast))
(while (setq EntNam (entnext OutVal))
(setq OutVal EntNam)
)
)
OutVal
)
;
; Marc'Antonio Alessi
; Function: ALE_Ss-After thanks to Michael Puckett (Ss-After)
;
; Version 1.01 - 20/12/2004 for empty DWG
; Version 1.02 - 30/09/2005
; Version 1.03 - 06/05/2010 to support Bricscad
;
; Description:
; get a selection set of items after EntNam in the database
;
; Arguments: An entity name
;
; Return Values:
; A selection set;
; otherwise nil, if there are no entities after EntNam
;
; Examples:
; (setq marker (ALE_LASTENT)) ...create new entities...
; to include reference entity:
; (command "_.MOVE" (ALE_SS-AFTER marker) marker "" ...)
; Note: NOT valid if marker is a SEQEND of
; blocks with attrib or old polylines (PLINETYPE = 0)
;
; not include reference entity:
; (command "_.MOVE" (ALE_SS-AFTER marker) "" ...)
;
(defun ALE_Ss-After (EntNam / SelSet)
(cond
( (not EntNam) (ssget "_X" '((0 . "~VIEWPORT"))) ); "~VIEWPORT" x Bricscad
( (setq EntNam (entnext EntNam))
(setq SelSet (ssadd EntNam))
(while (setq EntNam (entnext EntNam))
(if (entget EntNam) (ssadd EntNam SelSet))
)
SelSet
)
)
)
(setq entlast (ALE_LastEnt))
;THIS SECTION IS WHERE THE GLITCH HAPPENS
(command "leader"
orig
(list (xm 2) (ym 2))
""
""
(strcat daddep "\"D x " dadwid "\"W Dado")
""
)
(setq lst (mapcar 'cadr (ssnamex (ALE_Ss-After lastent))))
(setq ent (vl-remove-if-not '(lambda(e) (equal (assoc 0 (entget e)) '(0 . "LEADER"))) lst))
(setq leaderset (ssadd ent leaderset)) ;Adds the text to the selection set