Hey Aus,
I think I recognise that code from somewhere....
Are you saying you would like to continue inserting XREFs until the users decides to stop?
instead of invoking the command each time?


Registered forum members do not see this ad.
Hello...
I've got this:
Can I use the xattach above and to somehow first ask me "Do you want to atach from another folder?" If yes, I can go to another folder, if no it continues=?Code:(defun c:XREFIN (/ varlist oldvars ans) (setq varlist (list "CMDECHO" "CLAYER" "CTAB") oldvars (mapcar 'getvar varlist)) (setvar "cmdecho" 0) (if (/= (getvar "ctab") "Model") (progn (setq svar (dos_msgbox "New VPORT" "New VPORT?" 4 3 ) ) (IF (= svar 6) (progn (if (not (tblsearch "LAYER" "P-------VPORT")) (command "-layer" "M" "P-------VPORT" "C" "7" "P-------VPORT" "P" "N" "P-------VPORT" "") (setvar "clayer" "P-------VPORT")) (prompt "Create New VPORT...") (command "-vports" pause pause))) (setvar "ctab" "MODEL") (command "_.ucs" "w") (if (not (tblsearch "LAYER" "P-------XREF")) (command "-layer" "M" "P-------XREF" "C" "7" "P-------XREF" "LO" "P-------XREF" "") (setvar "clayer" "P-------XREF")) (command "._XAttach") (while (> (getvar "CMDACTIVE") 0) (command pause)) (command "_.ucs" "P")) (alert "VPORT cant be created in modelspace!!")) (mapcar 'setvar varlist oldvars) (princ))
Is it possible to attach xrefs from another folders?
Best regards!
I think I need to have the similiar function
Code:(if (/= smothing ...) (progn (setq svar (dos_msgbox "From another Folder" "From another folder?" 4 3 ) ) (IF (= svar 6) (progn .... Another folder or not lisp-code ...
Hey Aus,
I think I recognise that code from somewhere....
Are you saying you would like to continue inserting XREFs until the users decides to stop?
instead of invoking the command each time?
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper


Yes, exactly what I want
Thanx!!!
I don't have dos functions, but perhaps:
Code:(defun c:XREFIN (/ varlist oldvars svar flag ans) (setq varlist (list "CMDECHO" "CLAYER" "CTAB") oldvars (mapcar 'getvar varlist)) (setvar "cmdecho" 0) (if (/= (getvar "ctab") "Model") (progn (initget "Yes No") (setq svar (getkword "\nNew Viewport? {Y/N} <No> : ")) (if (= "Yes" svar) (progn (if (not (tblsearch "LAYER" "P-------VPORT")) (command "-layer" "M" "P-------VPORT" "C" "7" "P-------VPORT" "P" "N" "P-------VPORT" "") (setvar "clayer" "P-------VPORT")) (prompt "Create New VPORT...") (command "-vports" pause pause))) (setvar "ctab" "MODEL") (command "_.ucs" "w") (if (not (tblsearch "LAYER" "P-------XREF")) (command "-layer" "M" "P-------XREF" "C" "7" "P-------XREF" "LO" "P-------XREF" "") (setvar "clayer" "P-------XREF")) (while (not flag) (command "._XAttach") (while (> (getvar "CMDACTIVE") 0) (command pause)) (initget "Yes No") (setq ans (getkword "\nInsert Another? {Y/N} <Yes> : ")) (if (= ans "No") (setq flag T))) (command "_.ucs" "P")) (alert "VPORT cant be created in modelspace!!")) (mapcar 'setvar varlist oldvars) (princ))
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper


Thanx Sir for the great help.
Exactly what I wanted...
Regards!
Registered forum members do not see this ad.
No Probs, glad it worked for you![]()
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper
Bookmarks