Results 1 to 3 of 3

Thread: "xopen" at specific point and zoom

  1. #1
    Woo! Hoo! my 1st post
    Join Date
    2015-12
    Posts
    1
    Login to Give a bone
    0

    Default "xopen" at specific point and zoom

    Hi friends.

    I wonder...
    Is there a way to "modify" the xopen behaviour, in a way that the xref'ed drawing will be opened in the same relative size and location
    it appears in the hosting dwg while the xopen command is trigered?

    Will someone pick up the glove?

    Thanks,
    Izy.

  2. #2
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: "xopen" at specific point and zoom

    To write in lisp would be dificult. Consitering the xref could be placed at any coordinates, scale or rotation. You also want to be viewing the same area as the host drawing. Isn't Edit Xref in place already close to what you're looking for?

  3. #3
    I could stop if I wanted to CadDog's Avatar
    Join Date
    2005-06
    Location
    So Ca
    Posts
    439
    Login to Give a bone
    0

    Default Re: "xopen" at specific point and zoom

    Here an old lisp that once worked.
    I haven't done lisps for a few years now.

    I added the XBG back in 1996 I use to be very active in writing code.

    Maybe someone can go from here: Hey it's a start... )

    Code:
    ;     NAME: CIV-XGO ( CCXREF )
    ;
    ;     Open an Master file by picking
    ;
    ;     Master file name is derived from the attachment name,
    ;     with the X chopped off
    ;
    ;
    ;     Written by :    M. Kiker 73423,1707
    ;     Date:           11/95
    ;     Revised:     4/96 - I. Cruz, J. Wheat - Added zoom window definition - xbg
    ;
    ;     USE AT YOUR OWN RISK...
    ;
    ;
    ;     Copyright (C) 1995 by Mark Kiker
    ;
    ;     Permission to use, copy, modify, and distribute this software 
    ;     for any purpose and without fee is hereby granted, provided 
    ;     that the above copyright notice appears in all copies and that 
    ;     both that copyright notice and this permission notice appear in 
    ;     all supporting documentation.
    ;
    ;     THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED
    ;     WARRANTY.  ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR
    ;     PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.
    ;     ****************************************************************
    
    (defun catcherr (s)
         (if (/= s "Function cancelled")   ; If an error (such as CTRL-C) occurs
              (princ (strcat "\nError: " s)) ; while this command is active...
         )
         (setq p nil)                      ; Free selection set
         (setq *error* olderr)             ; Restore old *error* handler
         (princ)
    )
    
    
    
    (defun c:CCXREF()
         
         (setq olderr *error*
         *error* catcherr)
         (setq xrefpic (entsel "Pick XREF to OPEN: "))
         (setq xrefinfo (entget (car xrefpic)))
         (setq xrefgoname (cdr (assoc 2 xrefinfo)))
         (setq xlen (strlen xrefgoname))
         (setq xrefgoname1 (substr xrefgoname 2 xlen))
         (setq xrefgoname (strcat (getvar "dwgprefix") xrefgoname1))
         
         (Setq goyes (getstring (strcat "\nDo you want to call up " xrefgoname "?  <Yes>: ")))
         (if (or (= goyes "") (= goyes "Y") (= goyes "y"))
              (progn
                   (prompt (strcat "Saving " (getvar "dwgname") " and calling up " xrefgoname "\n"))
                   (if (findfile (strcat xrefgoname ".dwg"))
                        (progn
                             ;(command "tilemode" "0" "Pspace" "qsave")
                             ;(command "tilemode" "1")
                             (xbg)
                             ;(command "open" xrefgoname)
                 )
            )
                       )
                        (progn
                             (prompt (strcat "File " xrefgoname " not found"))
                             (princ)
                        )
                   )
              )
         
    
    ;---------- Check to make sure its an XREF file
    
    (defun CHKREF (/ blk_name blk_list)
         (setq check_val nil)
         (setq XREF_LIST nil)
         (setq BLK_NAME (cdr (assoc 2 (tblnext "BLOCK" T)))
         BLK_LIST (list BLK_NAME))
         (while (/= BLK_NAME nil)  
              (setq XREF_NAME (cdr (assoc 1 (tblsearch "BLOCK" blk_name))))
              (setq BLK_NAME (cdr (assoc 2 (tblnext "BLOCK"))))
              (if (/= XREF_NAME nil)
                   (setq XREF_LIST (cons XREF_NAME XREF_LIST))
              )
         )
         (while (/= XREF_LIST nil)
              (setq XREF (car XREF_LIST)
                   XREF_LIST (cdr XREF_LIST)
              )
              (setq len_of_xname (strlen XNAME))
              (setq len_of_xref (strlen XREF))
              (setq start_num 1)
              ;    (CHECKPATH)
              (setq detach_name (substr XREF start_num len_of_xname))
              (if (= (strcase detach_name)(strcase xname)) ;======== A MATCH
                   (progn
                        (setq check_val 1)
                        (setq xref_list nil)
                   )
                   (setq check_val 0)
              )
         )
         (princ)
    )
    (defun xbg ()
         (setq $vartile (getvar "tilemode"))
         (setq $vardwg (getvar "dwgname"))
         (setq $prevdwg (open "$prevdwg.txt" "w"))
         (write-line $vardwg $prevdwg)
         (close $prevdwg)
         ;
         (prompt (strcat "\nPick Window / (ENTER for Current Display):"))
         (setq $choice (grread nil 4 0))
         (setq grtype (car $choice))
         (setq grb (car (cdr $choice)))
         (setq $viewdp1 grb)
         ;
         (if (= GRB 13)(currdisp));IF EQUALS CR-return
         (if (= GRB 32)(currdisp));IF EQUALS (SP) Spacebar
         (if (= grtype 3)(pickdisp))
         ;
         ;(setq $choice (getstring "\n(P)ick Window / (ENTER for Current Display):"))
         ;(setq $choice (strcase $choice))
         ;(if (= $choice "")(currdisp))
         ;(if (= $choice "P")(pickdisp))
    )
    (defun currdisp ()
         (setq $vctr (getvar "VIEWCTR"))
    This lisp as you can see is from 1996.

    What needs to happen is simple but like I said before, it has been a long this since I have written a lisp from scratch.

    I see you can call "XOPEN" after you store the pick point x and y. Once the file opens call the same x and y point and zoom to it.

    These are my thoughts but I hope someone else can create this lisp.

    I wish I could be more help.

    Jesse
    Last edited by CadDog; 2013-06-25 at 10:38 PM. Reason: adding more thoughts

Similar Threads

  1. Replies: 0
    Last Post: 2012-06-06, 11:54 AM
  2. "Point de base du projet" et "Point de relevé"
    By fabrice.bon in forum Revit Architecture - General
    Replies: 0
    Last Post: 2010-03-30, 10:53 AM
  3. Display problems: Revit won't "zoom" past a certain point...
    By FWSchreck in forum Revit Architecture - General
    Replies: 8
    Last Post: 2009-10-01, 02:58 PM
  4. Is there an "xopen" equivalent?
    By gordon.84736 in forum Revit Architecture - General
    Replies: 1
    Last Post: 2005-07-01, 01:07 AM

Posting Permissions

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