Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LISP control of Xref path type

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
274 Views, 5 Replies

LISP control of Xref path type

I am looking for an AutoLISP method for
1: making a current Xref Path type No Path
2: making the default Path type No Path, ideally forever, but just for the
session is OK.


On the first, I hope the answer isn't to just parse the actual path, but if
that is the only way, then I guess I can live with it.


Best,
Gordon
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: Anonymous

FYI, this is R2005, not R2006.


Gordon
Message 3 of 6
Anonymous
in reply to: Anonymous

hi,


> 2: making the default Path type No Path, ideally forever, but just for the
> session is OK.


I am interested by this point too.


here a lsp to remove path.


Bruno Toniutti
Message 4 of 6
Anonymous
in reply to: Anonymous

Il se trouve que BTO a formulé :
> hi,
>
>
>> 2: making the default Path type No Path, ideally forever, but just for the
>> session is OK.
>
>
> I am interested by this point too.
>
>
> here a lsp to remove path.
>
>
> Bruno Toniutti


Hello, I have a problem with your code,
after lign 23 there is some caracters secial !


(pro??4(€€€€€€€€¡Í?ÑÄ?aÉ9?µ €¡Ù°µ?¥±?¹?µ?µ??Í?€(cdr (assoc 1 (entget
(tblobjname "block" XrName))))))


Daniel


--
Ceci est une signature automatique de MesNews.
Site : http://www.mesnews.net
Message 5 of 6
Anonymous
in reply to: Anonymous

Bonjour Daniel, j'esp�re que �a mieux passer comme �a :


sure there is a problem for me too,
I try again to post it....


; source ng Autodesk.autocad.customization
; Author : Unkwon
; test : acad2002 NT 2000
; release : 11 04 2003


(defun c:XRP ( / XrLstP XrName XrNamF)
(setvar "cmdecho" 1 )
(command "_.undo" "_begin")
(setq XrLstP
(apply
'append
(mapcar
'(lambda (x / elist code)
(if (and (= (logand (setq code (cdr (assoc 70 (setq elist (entget
(tblobjname "block" x)))))) 4) 4)
(wcmatch (cdr (assoc 1 (entget (tblobjname "block" x))))
"*\\*")
)
(list (cdr (assoc 2 elist))
)
)
)
(ai_table "block" 0) ; or use (GetNames "block") by Michael Puckett
)
)
) ; end setq XrLstP
(if XrLstP
(progn
(princ "Removing Paths for Xrefs: ")
(foreach XrName XrLstP
(progn
(setq XrNamF (vl-filename-base (cdr (assoc 1 (entget (tblobjname
"block" XrName))))))
(command "_.-xref" "_path" XrName XrNamF)
(princ (strcat XrNamF " "))
)
) ; end foreach
) ; end progn
(princ "\nThere are NO Xrefs with Paths, so please stop that.")
)
(command "_.undo" "_end")
(setvar "cmdecho" 1 )
(princ)
)
Message 6 of 6
Anonymous
in reply to: Anonymous

BTO a couché sur son écran :
> Bonjour Daniel, j'esp?re que ?a mieux passer comme ?a :
>
>
> sure there is a problem for me too,
> I try again to post it....
>
>
> ; source ng Autodesk.autocad.customization
> ; Author : Unkwon
> ; test : acad2002 NT 2000
> ; release : 11 04 2003
>
>
> (defun c:XRP ( / XrLstP XrName XrNamF)
> (setvar "cmdecho" 1 )
> (command "_.undo" "_begin")
> (setq XrLstP
> (apply
> 'append
> (mapcar
> '(lambda (x / elist code)
> (if (and (= (logand (setq code (cdr (assoc 70 (setq elist (entget
> (tblobjname "block" x)))))) 4) 4)
> (wcmatch (cdr (assoc 1 (entget (tblobjname "block" x))))
> "*\\*")
> )
> (list (cdr (assoc 2 elist))
> )
> )
> )
> (ai_table "block" 0) ; or use (GetNames "block") by Michael Puckett
> )
> )
> ) ; end setq XrLstP
> (if XrLstP
> (progn
> (princ "Removing Paths for Xrefs: ")
> (foreach XrName XrLstP
> (progn
> (setq XrNamF (vl-filename-base (cdr (assoc 1 (entget (tblobjname
> "block" XrName))))))
> (command "_.-xref" "_path" XrName XrNamF)
> (princ (strcat XrNamF " "))
> )
> ) ; end foreach
> ) ; end progn
> (princ "\nThere are NO Xrefs with Paths, so please stop that.")
> )
> (command "_.undo" "_end")
> (setvar "cmdecho" 1 )
> (princ)
> )


Hi,
Thank's is good now !
Daniel


--
Ceci est une signature automatique de MesNews.
Site : http://www.mesnews.net

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report