+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Nov 2008
    Posts
    155

    Default Attach Xref from different folders

    Hello...

    I've got this:

    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))
    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=?

    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 ...

  2. #2
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    16,736

    Default

    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 ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  3. #3
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Nov 2008
    Posts
    155

    Default

    Yes, exactly what I want

    Thanx!!!

  4. #4
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    16,736

    Default

    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 ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  5. #5
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Nov 2008
    Posts
    155

    Default

    Thanx Sir for the great help.

    Exactly what I wanted...

    Regards!

  6. #6
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    16,736

    Default

    Registered forum members do not see this ad.

    No Probs, glad it worked for you
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

Similar Threads

  1. Design Tree Folders
    By spittle in forum SolidWorks
    Replies: 0
    Last Post: 23rd Jan 2009, 12:32 pm
  2. No 'Attach Image' Option in Xref
    By SeaRR85 in forum AutoCAD General
    Replies: 12
    Last Post: 18th Dec 2008, 07:08 pm
  3. cannot attach a dwg as an xref (acad 2006)
    By anothercadguy in forum AutoCAD General
    Replies: 2
    Last Post: 4th Dec 2008, 12:13 am
  4. New files and file folders
    By J-LYLE in forum Catch All
    Replies: 10
    Last Post: 19th Jun 2008, 06:03 pm
  5. Xref Attach file not displaying when added
    By irishcowboy in forum AutoCAD Beginners' Area
    Replies: 2
    Last Post: 12th May 2008, 03:19 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts