Jump to content
JeepMaster

Need help on my Detach/Audit/Bind/Purge code

Recommended Posts

JeepMaster

I use this code at work before sending dwgs out to clients. It basically detach all unloaded xrefs, Audit the dwg, Bind xrefs, and purge the dwg. The code here works fine, but there's no error trap. If I press ESC in the middle of the process, it will leave my "status bar" with the wrong text ("modemacro" need to be set back to default value "." if exit earily). I'm not too good with codes, so don't really know how to set up the error trap. Any expert here can help a noob out. Thanks.

 

 
(defun c:SENT ( / )
 (setvar "modemacro" "Detach/Audit/Bind/PurgeAll processing......please wait......")
 (prompt "\n---Detach unloaded Xref, Audit, Bind, PurgeAll---")
 (prompt "\nDetaching...")
 (vlax-for block (vla-get-blocks
   (vla-get-activedocument
   (vlax-get-acad-object)))
     (if (and (= :vlax-true (vla-get-isxref block))
     (= 0 (vla-get-count block))
       )
     (vla-detach block)
     )
 )
 (prompt "...done")
 (prompt "\nAuditing...")(terpri)
 (command "_audit" "y")
 (prompt "\nBinding all Xrefs...")
 (setvar "bindtype" 1)
 (command "-xref" "b" "*")
 (prompt "...done")(terpri)
 (prompt "\nPurging #1")(terpri)
 (command "-purge" "a" "*" "N")
 (prompt "\nPurging #2")(terpri)
 (command "-purge" "a" "*" "N")
 (prompt "\nPurging #3")(terpri)
 (command "-purge" "a" "*" "N")
 (prompt "\n---Detach, Audit, Bind, PurgeAll completed!---")
 (setvar "modemacro" ".")
 (princ)
)

Share this post


Link to post
Share on other sites
ASMI

Something like this:

 

(defun c:SENT (/ *error* oldBnType)

 (defun *error*(msg)
   (setvar "modemacro" ".")
   (setvar "bindtype" oldBnType)
   (setvar "cmdecho" 1)
   (princ "\nDetach/Audit/Bind/PurgeAll terminated  ")
   (princ)
   ); end of *error*
 
 (setq oldBnType(getvar "bindtype"))
 (setvar "modemacro" "Detach/Audit/Bind/PurgeAll processing......please wait......")
 (prompt "\n---Detach unloaded Xref, Audit, Bind, PurgeAll---")
 (prompt "\nDetaching...")
 (vlax-for block (vla-get-blocks
   (vla-get-activedocument
   (vlax-get-acad-object)))
     (if (and (= :vlax-true (vla-get-isxref block))
     (= 0 (vla-get-count block))
       )
     (vla-detach block)
     )
 )
 (setvar "cmdecho" 0)
 (prompt "...done")
 (prompt "\nAuditing...")(terpri)
 (command "_audit" "y")
 (prompt "\nBinding all Xrefs...")
 (setvar "bindtype" 1)
 (command "-xref" "b" "*")
 (prompt "...done")(terpri)
 (prompt "\nPurging #1")(terpri)
 (command "-purge" "a" "*" "N")
 (prompt "\nPurging #2")(terpri)
 (command "-purge" "a" "*" "N")
 (prompt "\nPurging #3")(terpri)
 (command "-purge" "a" "*" "N")
 (prompt "\n---Detach, Audit, Bind, PurgeAll completed!---")
 (setvar "modemacro" ".")
 (setvar "cmdecho" 1)
 (princ)
); end of c:sent

Share this post


Link to post
Share on other sites
JeepMaster

THANKS ASMI,:thumbsup:

That's exactly what I needed to polish up my code. :D You're awsome!

Share this post


Link to post
Share on other sites
JeepMaster

Hey ASMI or any other experts,

I'm running into problems with dwgs having nested xref when I use this code shown above. As you might know you can't detach nested xref, and the only way I know how to bind this dwg is to reload the nested xref and freeze all the layers in the nested xref. So it will keep everything the same. I know it's kind of useless having xref and turning all the layers off. This is because we can't touch other people's dwgs (ie: architectual base plans) and I'm in electrical.

 

Anyways, so my question is can we modify the code so whenever a nested xref will not detach, load the xref and freeze all layers in that nested xref. Or better yet whenever an "Unloaded" xref will not detach, load the xref and freeze it. I just want the dwg to look exactly the same as before binding so I can sent it to the client. Please help guys!:(

Share this post


Link to post
Share on other sites
ASMI

Hi.

 

I can make your request. But next week, becouse today I have large work, and at weekand I will be far away from computers, internet, cable TV and other civization things... in the pine-tree forest near sea cost...

Share this post


Link to post
Share on other sites
JeepMaster

Hey ASMI,

Any luck on the code? Is it too hard?

Share this post


Link to post
Share on other sites
ASMI

Hi. Not too hard I think, but it's not 10 or 50 lines of code it's more lines... And I should find pair hours of a free time to do it. Do not worry I shall write for you this program.

Share this post


Link to post
Share on other sites
JeepMaster
Hi. Not too hard I think, but it's not 10 or 50 lines of code it's more lines... And I should find pair hours of a free time to do it. Do not worry I shall write for you this program.

Hey ASMI,

I don't want to cause you too much trouble. Have a go at it when ever you have some free time. People at work already love this code that I shared with them. I hope people here will find it useful.:)

Share this post


Link to post
Share on other sites
JeepMaster

bump bump :D

Share this post


Link to post
Share on other sites
JeepMaster

Okay, this has to be the most powerful Detach/audit/bind/purgeall code I've seen so far. Thanks to my friend Joe. He helped me out on the main part of this code. This version can handle nested, unloaded and unresolved xrefs. It will blow them all away when binding. Some parts might not be perfect as I have to combine my code to his code.:D Oh yeah, you MUST put a blank dwg named dummy.dwg in one of your search path folder.

Let me know what you guys think! or have any improvements.

 

(defun C:SENT ( / )

 (defun *error*(msg)
   (setvar "modemacro" ".")
   (setvar "bindtype" oldBnType)
   (setvar "cmdecho" 1)
   (princ "\n...Audit/Bind/PurgeAll terminated!!!  ")
   (princ)
   ); end of *error*

 (setvar "modemacro" "Audit/Bind/PurgeAll processing......please wait......")
 (setvar "cmdecho" 0)
 (prompt "\n--- Audit/Bind/PurgeAll......please wait---")
 (prompt "\nAuditing...")(terpri)
 (command "_audit" "y")
 (bind_xrefs)
 (prompt "\nPurging #1")(terpri)
 (command "-purge" "a" "*" "N")
 (prompt "\nPurging #2")(terpri)
 (command "-purge" "a" "*" "N")
 (prompt "\nPurging #3")(terpri)
 (command "-purge" "a" "*" "N")
 (prompt "\n--- Audit, Bind, PurgeAll completed! ---")
 (setvar "modemacro" ".")
 (setvar "cmdecho" 1)
 (princ)
); end of c:sent

(defun bind_xrefs ( / CMD)
 (setq oldBnType(getvar "bindtype"))
 (setq CMD (getvar "CMDECHO"))
 (setvar "CMDECHO" 0)
 (setvar "bindtype" 0)
 (setq XLIST (xref-status))
 (if XLIST 
   (progn
     (prompt "\nBinding all Xrefs...")
     (foreach n XLIST (rem-xref n))  
     (command "-xref" "b" "*" )
     (prompt "...done")(terpri)
   )  
 )
 (setvar "CMDECHO" CMD)
 (setvar "bindtype" oldBnType)
 (princ)
)

(defun rem-xref ( XL / XNAME XSTATUS )
 (setq XNAME (nth 0 XL))
 (setq XSTATUS (nth 2 XL))
 (if (= XSTATUS "UNLOADED")
   (rem_unload)
 )
 (if (= XSTATUS "UNRESOLVED")
   (rem_unload)
 )
)

(defun xref-status ( / d n f r)
 (while (setq d (tblnext "block" (null d)))
   (cond
     (
       (eq 4 (logand 4 (cdr (assoc 70 d))))
       (setq
         d (entget (tblobjname "block" (cdr (assoc 2 d))))
         n (cdr (assoc 2 d))
         p (cdr (assoc 3 d))
         f (cdr (assoc 70 d))
       )
       (setq r
         (cons
           (list n p
             (cond
               ( (eq 32 (logand 32 f)) "LOADED")
               ( (assoc 71 d) "UNLOADED")
               ( t "UNRESOLVED")
             )
           )
           r
         )
       )
     )
   )
 )
 (reverse r)
)


(defun rem_unload ( / )
 (setq DFILE (findfile "dummy.dwg"))
 (if (not DFILE)
   (prompt "\nCannot find dummy_xref drawing ")
   (progn
     (command "-xref" "p" XNAME DFILE)
     (command "-xref" "r" XNAME)
   )
 )
)

Share this post


Link to post
Share on other sites
bobafuka

I love the routine but....

...... all I get is...

Could you please help me and explain the problem?

 

Error: At least one of the specified xrefs failed to bind for an unknown

reason.*Invalid*

...Audit/Bind/PurgeAll terminated!!! :(

 

Regards,

Boba Fuka.

Share this post


Link to post
Share on other sites
JeepMaster
I love the routine but....

...... all I get is...

Could you please help me and explain the problem?

 

Error: At least one of the specified xrefs failed to bind for an unknown

reason.*Invalid*

...Audit/Bind/PurgeAll terminated!!! :(

 

Regards,

Boba Fuka.

 

Boba,

Can you tell me more about your xrefs? Are they nested/unresolved/loaded/unloaded... What happens when you bind them manually?

Share this post


Link to post
Share on other sites
bobafuka

Dear JeepMaster,

Thanks for your reply.

If I bind them manually, it must be done individually or the same error message appears but the all bind individually without error.

Some are nested but after running a script through the xref directory to detach all, purge x3, etc. multiple binding results in the same error.

They are restored with all the xrefs removed and re-overlaid afresh.

Still no good. None are unresolved. None are corrupt.

Soon, I will be required to be sending out the files (unfortunately, this company does that!) and binding will become an issue...

Please can we figure this out together... before I have to "dumb it all down"

Also, a useful tool would be to have a routine that will change all the xrefs state to overlays or attachments on request... Is that possible?

Regards,

Boba Fuka.

Share this post


Link to post
Share on other sites
JeepMaster

Boba,

Lets ignore my code for now. You're saying if you do a multiple bind manually, it gives you errors? If so, then you need to fix your xrefs first. Does any of your xref status said it needs to be reloaded? Try opening each xref and audit/purge/save them. Then try multiple bind again. Does it help? If not try "wblock" the whole dwg to a new one; re-xref in dwg; then bind.

 

Changing xref to overlay or attach seems possible. But I might need to do some digging to figure it out. The more experience coders here might be able to find a quick and simple solution.

Share this post


Link to post
Share on other sites
JeepMaster

Apparently someone already figure it out how to convert All Xref to Overlay, and All Xref to Attach. :D I found it in the Autodesk website. http://discussion1.autodesk.com/thread.jspa?threadID=427269 It's seems a lot more complicated than I thought. Here's the code. I'll have to test it out at work tomorrow.

 

(defun c:x2a () (xreftoattach nil))
(defun xreftoattach (namelst / uncommonblock uncommonblockclip a curlaystate cpath delme fdelme) ; xref to overlay
(if (= (type namelst) 'STR) (setq namelst (list namelst)))
(if (not namelst) (setq namelst (getxreflst)))
(setq count 0)
(while (or (findfile (strcat "ub" (itoa count) ".dwg")) (tblsearch "BLOCK" "ub" (itoa count))) (setq count (1+ count)))
(setq uncommonblock (strcat "ub" (itoa count) ".dwg"))
(command "point" "0,0" "wblock" (setq fdelme (strcat (getvar "dwgprefix") uncommonblock)) "" "0,0" (entlast) "")
(setq uncommonblockclip (substr uncommonblock 1 (- (strlen uncommonblock) 4)))
(command "undo" "begin")
(command "._-layer" "a" "save" "BEI" "" "" "")
(COMMAND ".-LAYER" "UNLOCK" "*" "")
(foreach a namelst 
(setq cpath (xrefpath a))
(command "xref" "attach" (findfile uncommonblock) "0,0" "" "" "")
(setq delme (ssget "x" (list (cons 2 uncommonblockclip))))
(command "xref" "path" uncommonblockclip cpath) 
(redefxrefs a uncommonblockclip)
(command "xref" "detach" a)
(command "rename" "block" uncommonblockclip a)
(if delme (command "erase" delme ""))
) ; foreach
(command "._-layer" "a" "restore" "BEI" "" "" "")
(command "._-layer" "a" "delete" "BEI" "" "" "")
(command "._-xref" "d" "ub*")
(command "undo" "e")
(vl-file-delete (strcat fdelme))
(princ)
) ; xreftoattach

(defun c:x2o () (xreftooverlay nil))
(defun xreftooverlay (namelst / uncommonblock uncommonblockclip a curlaystate cpath delme fdelme) ; xref to overlay
(if (= (type namelst) 'STR) (setq namelst (list namelst)))
(if (not namelst) (setq namelst (getxreflst)))
(setq count 0)
(while (or (findfile (strcat "ub" (itoa count) ".dwg")) (tblsearch "BLOCK" "ub" (itoa count))) (setq count (1+ count)))
(setq uncommonblock (strcat "ub" (itoa count) ".dwg"))
(command "point" "0,0" "wblock" (setq fdelme (strcat (getvar "dwgprefix") uncommonblock)) "" "0,0" (entlast) "")

(setq uncommonblockclip (substr uncommonblock 1 (- (strlen uncommonblock) 4)))
(command "undo" "begin")
(command "._-layer" "a" "save" "BEI" "" "" "")
(COMMAND ".-LAYER" "UNLOCK" "*" "")
(foreach a namelst 
(setq cpath (xrefpath a))
(command "xref" "overlay" (findfile uncommonblock) "0,0" "" "" "")
(setq delme (ssget "x" (list (cons 2 uncommonblockclip))))
(command "xref" "path" uncommonblockclip cpath) 
(redefxrefs a uncommonblockclip)
(command "xref" "detach" a)
(command "rename" "block" uncommonblockclip a)
(if delme (command "erase" delme ""))
) ; foreach
(command "._-layer" "a" "restore" "BEI" "" "" "")
(command "._-layer" "a" "delete" "BEI" "" "" "")
(command "._-xref" "d" "ub*")
(command "undo" "e")
(vl-file-delete (strcat fdelme))
(princ)
) ; xreftooverlay


;Routines used for both commands
(defun getxreflst (/ roughxrlst a cur xrlst)
(setq roughxrlst (findxref))
(foreach a roughxrlst
(setq cur (cdr (assoc 2 a)))
(setq xrlst (append xrlst (list cur)))
) ; foreach
xrlst
) ; getxreflst

;; The following code was written by R. Robert Bell, RobertB@MWEngineers.com
(defun findxref ( / tblitem xreflist)
(vl-Load-Com)
(vlax-For aBlk (vla-Get-Blocks (vla-Get-ActiveDocument (vlax-Get-Acad-Object)))
(cond ((= (vla-Get-IsXref aBlk) :vlax-True)
(setq xRefs (cons (vla-Get-Name aBlk) xRefs)))))
(foreach blkN xRefs 
(setq ss (ssget "X" (list (cons 0 "Insert") (cons 2 blkN)))) 
(cond (ss (setq xreflist (append xreflist (list (entget (ssname ss 0)))))))) 
xreflist
)
;------------------------------------------------------------- --------------

(defun redefxrefs (old new / ss count cur)
(setq ss (ssget "x" (list (cons 0 "INSERT") (cons 2 old))))
(setq count (sslength ss)) 
(while (>= (setq count (1- count)) 0)
(setq cur (ssname ss count))
(entmod (subst (cons 2 new) (cons 2 old) (entget cur)))
) ; while
(sslength ss)
) ; redefxrefs

(defun xrefpath (a ) ; xref path from xref name
(setq e (tblobjname "BLOCK" a))
(cdr (assoc 1 (entget e)))
) ; xrefpath

;End of Routines used for both commands. 

Share this post


Link to post
Share on other sites
bobafuka
Boba,

You're saying if you do a multiple bind manually, it gives you errors? If so, then you need to fix your xrefs first. Does any of your xref status said it needs to be reloaded? Try opening each xref and audit/purge/save them. Then try multiple bind again. Does it help? If not try "wblock" the whole dwg to a new one; re-xref in dwg; then bind.

 

 

Sorry for the delay. I have been working around this - the files are decendants of ADT - The End!.

And until I get 2007, the issue will bug me for the entire project - which I am smug to say, that after fighting tooth and nail with my "AutoCAD illiterate, refuses to learn anything new for fear of his brain exploding" line manager, I submitted to "dumbing down" my drawings much to the fury of the director the following day!!!!!!

.... He will join us or die.... Never underestimate the power of the force... The Emporer is not as forgiving as I am.... Ha haha HAHAHAAAA......

Ahum... Anyway - I still need to figure this out....

A multi manual insert bind produces the usual "..invalid.." response.

Perhaps the dwg's need cleaning by Wblocking out but who has the time. And if they are ADT entities, surely the errors will travel..?

Share this post


Link to post
Share on other sites
JeepMaster

Guys,

I need some help to fix up my SENT.lsp code. I've added undo commands to the code so if there are xrefs that doesn't bind, it will revert everything back to original condition before the SENT command. This way of undoing things doesn't seem to be very reliable as it works maybe 9 out of 10 times. I'm sure there are other ways of undoing the xref pathing, but it's beyond my lisp knowledge.

 

On my previous versions, whenever I run into problem xrefs that doesn't bind, it will leave the xref pathed to the "dummy.dwg" which is not what I wanted. I would rather leave it back to the original paths of the problem xref.:(

 

 

;...............................................................................
;
;       << Detach unloaded/unresolved xrefs, Bind xrefs, Audit, Purge >>
;                               << Version 2.1 >>
;
;          NOTE: Must have a blank dwg in search path name "dummy.dwg" 
;
;...............................................................................

(defun C:SENT ( / )
 
 (defun *error*(msg)
   (setvar "modemacro" ".")
   (setvar "bindtype" oldBnType)
   (setvar "cmdecho" 1)
   [color=Red](command "_undo" "E")
   (command "_undo" "1")[/color]
   (command "regenall")(terpri)
   (princ "\n...Audit/Bind/PurgeAll terminated!!!  ")
   (princ)
   ); end of *error*
 
 [color=Red](command "_undo" "BE")[/color]
 (setvar "modemacro" "Audit/Bind/PurgeAll processing......please wait......")
 (setvar "cmdecho" 0)
 (prompt "\n--- Audit/Bind/PurgeAll......please wait---")
 (prompt "\nAuditing...")(terpri)
 (command "_audit" "y")
 (bind_xrefs)
 (prompt "\nPurging RegApps")(terpri)
 (command "-purge" "R" "*" "N")
 (prompt "\nPurging #1")(terpri)
 (command "-purge" "a" "*" "N")
 (prompt "\nPurging #2")(terpri)
 (command "-purge" "a" "*" "N")
 (prompt "\nPurging #3")(terpri)
 (command "-purge" "a" "*" "N")
 [color=Red](command "_undo" "E")(terpri)[/color]
 (prompt "\n--- Audit, Bind, PurgeAll completed! ---")
 (setvar "modemacro" ".")
 (setvar "cmdecho" 1)
 (princ)
); end of c:sent



(defun bind_xrefs ( / CMD)
 (setq oldBnType(getvar "bindtype"))
 (setq CMD (getvar "CMDECHO"))
 (setvar "CMDECHO" 0)
 (setvar "bindtype" 0)
 (setq XLIST (xref-status))
 (if XLIST 
   (progn
     (prompt "\nBinding all Xrefs...")
     (foreach n XLIST (rem-xref n))  
     (command "-xref" "b" "*" )
     (prompt "...done")(terpri)
   )  
 )
 (setvar "CMDECHO" CMD)
 (setvar "bindtype" oldBnType)
 (princ)
)


(defun rem-xref ( XL / XNAME XSTATUS )
 (setq XNAME (nth 0 XL))
 (setq XSTATUS (nth 2 XL))
 (if (= XSTATUS "UNLOADED")
   (rem_unload)
 )
 (if (= XSTATUS "UNRESOLVED")
   (rem_unload)
 )
)


(defun xref-status ( / d n f r)
 (while (setq d (tblnext "block" (null d)))
   (cond
     (
       (eq 4 (logand 4 (cdr (assoc 70 d))))
       (setq
         d (entget (tblobjname "block" (cdr (assoc 2 d))))
         n (cdr (assoc 2 d))
         p (cdr (assoc 3 d))
         f (cdr (assoc 70 d))
       )
       (setq r
         (cons
           (list n p
             (cond
               ( (eq 32 (logand 32 f)) "LOADED")
               ( (assoc 71 d) "UNLOADED")
               ( t "UNRESOLVED")
             )
           )
           r
         )
       )
     )
   )
 )
 (reverse r)
)




(defun rem_unload ( / )
 (setq DFILE (findfile "dummy.dwg"))
 (if (not DFILE)
   (prompt "\nCannot find dummy_xref drawing ")
   (progn
     (command "-xref" "p" XNAME DFILE)
     (command "-xref" "r" XNAME)
   )
 )
)

Share this post


Link to post
Share on other sites
JeepMaster

No one can help huh....oh well. It still works I guess...so far:unsure:.

 

Here's my latest revision.

;...............................................................................
;
;       << Detach unloaded/unresolved xrefs, Bind xrefs, Audit, Purge >>
;                              << June 2009 >>
;                              << Version 2.2 >>
;
;          NOTE: Must have a blank dwg in search path name "dummy.dwg" 
;
;...............................................................................

(defun C:SENT ( / )
 
 (defun *error*(msg)
   (setvar "bindtype" oldBnType)
   (setvar "cmdecho" 1)
   (princ "\n...undoing SENT...")
   (command "_undo" "E")
   (command "_undo" "1")
   (command "regenall")(terpri)
   (princ "\n...SENT Undone!...Audit/Bind/PurgeAll terminated!!!  ")
   (setvar "modemacro" ".")
   (princ)
   ); end of *error*
 
 (command "_undo" "BE")
 (setvar "modemacro" "Audit/Bind/PurgeAll processing......please wait......")
 (setvar "cmdecho" 0)
 (prompt "\n--- Audit/Bind/PurgeAll......please wait---")
 (prompt "\nAuditing...")(terpri)
 (command "_audit" "y")
 (bind_xrefs)
 (prompt "\nPurging RegApps")(terpri)
 (command "-purge" "R" "*" "N")
 (prompt "\nPurging #1")(terpri)
 (command "-purge" "a" "*" "N")
 (prompt "\nPurging #2")(terpri)
 (command "-purge" "a" "*" "N")
 (prompt "\nPurging #3")(terpri)
 (command "-purge" "a" "*" "N")
 (command "_undo" "E")(terpri)
 (prompt "\n--- Audit, Bind, PurgeAll completed! ---")
 (setvar "modemacro" ".")
 (setvar "cmdecho" 1)
 (princ)
); end of c:sent



(defun bind_xrefs ( / CMD)
 (setq oldBnType(getvar "bindtype"))
 (setq CMD (getvar "CMDECHO"))
 (setvar "CMDECHO" 0)
 (setvar "bindtype" 0)
 (setq XLIST (xref-status))
 (if XLIST 
   (progn
     (prompt "\nBinding all Xrefs...")
     (foreach n XLIST (rem-xref n))  
     (command "-xref" "b" "*" )
     (prompt "...done")(terpri)
   )  
 )
 (setvar "CMDECHO" CMD)
 (setvar "bindtype" oldBnType)
 (princ)
)


(defun rem-xref ( XL / XNAME XSTATUS )
 (setq XNAME (nth 0 XL))
 (setq XSTATUS (nth 2 XL))
 (if (= XSTATUS "UNLOADED")
   (rem_unload)
 )
 (if (= XSTATUS "UNRESOLVED")
   (rem_unload)
 )
)


(defun xref-status ( / d n f r)
 (while (setq d (tblnext "block" (null d)))
   (cond
     (
       (eq 4 (logand 4 (cdr (assoc 70 d))))
       (setq
         d (entget (tblobjname "block" (cdr (assoc 2 d))))
         n (cdr (assoc 2 d))
         p (cdr (assoc 3 d))
         f (cdr (assoc 70 d))
       )
       (setq r
         (cons
           (list n p
             (cond
               ( (eq 32 (logand 32 f)) "LOADED")
               ( (assoc 71 d) "UNLOADED")
               ( t "UNRESOLVED")
             )
           )
           r
         )
       )
     )
   )
 )
 (reverse r)
)




(defun rem_unload ( / )
 (setq DFILE (findfile "dummy.dwg"))
 (if (not DFILE)
   (prompt "\nCannot find dummy_xref drawing ")
   (progn
     (command "-xref" "p" XNAME DFILE)
     (command "-xref" "r" XNAME)
   )
 )
)

Share this post


Link to post
Share on other sites
Lee Mac

I haven't looked properly over your code JeepMaster, and I haven't got much experience with XREFs, but you could use some kind of vl-catch-all-apply arrangement when binding so that the routine doesn't crash out if the xref fails to bind..

 

Not sure if something like this would work?

 

([color=Blue][b]vl-catch-all-apply[/b][/color]
   ([b][color=Blue]function[/color][/b]
     ([b][color=Blue]lambda[/color][/b] (x)
       ([b][color=Blue]vla-bind[/color][/b] x [b][color=Blue]:vlax-false[/color][/b])))
   ([color=Blue][b]mapcar[/b][/color] '[b][color=Blue]vlax-ename->vla-object[/color][/b] [b][i]<list of XREF Entities>[/i][/b]))

Share this post


Link to post
Share on other sites
JeepMaster

LeeMac,

My friend helped me out on writing the lisp. I only know very limited amount of lisp. Only if I knew what you mean by "catching something in some math function while riding in a lamborghini, something about taking laxative, and reading a map in a car" then I might know what you were talking about. :lol::lol::lol::lol::lol:

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...