AutoCAD Visual LISP / AutoLISP :: Open Xref In Selected Layout And Zoom To Match View?

May 28, 2013

I have used Autocad since 1991, and my current job required me to use Microstation. One feature I liked from Microstaiton is the ability to select and open an external DGN reference, and then match the view of the parent DGN. In AutoCAD, you can also select and open an xref, but the DWG opens to the previous saved view, and not to the desired view that matches the layout.

My thought was to experienting with lisp or scipt and export the "Viewctr", "Viewtwist" and "Viewsize" variables to a text file, then importing the text file and using the "Viewtwist" as my "SNAPANG" value, then "Viewctr" as my "ZOOM, CENTER" value, and finally the "Viewsize" as the "Enter magnification or height:" value.

But, alas, have no time, and not quite the knowledge to duplicate MicroStation's open-xref-and-zoom-to-view feature.

View 6 Replies


ADVERTISEMENT

AutoCAD Civil 3D :: Open Xref In Selected Layout And Zoom To Match View

May 29, 2013

I have used Autocad since 1991, and my current job required me to use Microstation. One feature I liked from Microstation is the ability to select and open an external DGN reference, and then match the view of the parent DGN, called the "EXCHANGE" command. In AutoCAD, you can also select and open an xref, but the DWG opens to the previous saved view, and not to the desired view that matches the layout.

My thought was to experiment with lisp or script and export the "Viewctr", "Viewtwist" and "Viewsize" variables to a text file, then importing the text file and using the "Viewtwist" as my "SNAPANG" value, then "Viewctr" as my "ZOOM, CENTER" value, and finally the "Viewsize" as the "Enter magnification or height:" value.

But, alas, I have no time, and not quite the knowledge to duplicate MicroStation's open-xref-and-zoom-to-view feature. I hesitate using the REFEDIT, which works fine for regular AutoCAD, but not so much for Civil 3D and the objects it creates (labels and other items with data shortcuts).

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Naming Single Layout Tab To Match File Name?

Aug 2, 2012

Trying to get the files I use which are single-layout tab files to name the layout tab to match the file name, minus the .DWG extension.

Here is what I am trying to use, but it doesn't seem to be working.

(DEFUN C:RRT (/ name)
 (setq name (getvar (vl-filename-base (getvar "dwgname"))))
 (command "-layout" "rename" name "")
(princ)
)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Selected Object Is In XRef To Highlight

Aug 15, 2013

I think there is a function that will cause the selected object that is in the XRef to highlight.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Copying Layout Tab And Xref New Title Block

Apr 30, 2013

I need a routine that will duplicate the current sheet's Layout tab and content to the next tab, set it current, delete the titleblock (by name) on the new tab and reference in a differently named titleblock, 1:1, 0,0 onto the new Layout tab. I'll be running this in a batch script.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Zoom Layout (Entities Or Insertion Point Extents)

Oct 12, 2012

I have a drawing with various layouts that when I do a Zoom Extents the drawings is reduced to the size of a point.

I have done all the usual, ie: look for extra entities that are "out in space" so to speak and there are none.

I wonder if I have a block or image which may have an insertion point "out in space" and if this may be the issue.

Is there some way to Select all entities or Blocks (insertion point) that may exist outside a particular area ie: drawing limits.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Zoom Extents / Save All / Close All Open Drawings?

May 26, 2010

how to make a routine for zoom extents, save all, and close all open drawings in a single routine?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Xref Layer With Xref Name?

Jul 31, 2009

Is it possible to run a lisp which can extract all the xref names, make a layer with that name and then change the xref on the layer? I have got a similar routine from earlier posts but it doesn't work if any xrefs inserted in paper space (works fine on model space). could change this routine allowing to change the layer of xref in paper space too.

(defun dxf (i a) (cdr (assoc i a)))
(defun c:lxr ( )
(setq ss (ssget "x" '((0 . "INSERT"))))

[Code].....

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Xref Reactor Object ID To Xref Name

Oct 2, 2012

I am using (trying to anyway) a :VLR-xrefSubcommandReloadItem reactor.  My only question is how to get the xref/block name from the 'reactor callback data' Object ID.

I am ultimately trying to pass it to (vla-get-xrefdatabase ....), but I cannot figure out how to turn the second parameter from the reactor callback data into something I can use - for example the second parameter returned may be "65" or some other number. 

Civil 3D 2011
Windows 7 x64

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Match Properties With Colors And Not By Layer?

Dec 30, 2013

I've been looking for commant that will allow me to copy a selection of entities to another layer for details. I'll need to be able to select several objets all at once and have each of them maintain the correct colors, linetypes, lineweights. Most everything is set as bylayer but that makes everything change once the objects are moved to a new layer.

How can I keep the everything looking like it never changed except for the fact that it will be moved to a new layer - layer 0 in this situation?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Match TIF To A Drawing File In 2011

Apr 26, 2013

Create a script or a lisp file to match a tif to a drawing file in autocad 2011?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Mleader With Xref Name?

Jan 27, 2012

I am looking for some mleader customization.Basically looking for a mleader that will add an objects name(in my case an xref or block) in the text. Attached is a picture of our current process... nothing special. basically instead of typing in text we use the insert field. In the field dialog that opens we select "object" under Field names, then under object the type button is pressed to select object(in my case and xref or block) then under property the "Name" option is chosen. This will insert the xref name in the multileader. This is not terribly hard but am curious if I can automate and save some steps.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Set Xref Insert To 0,0,0

May 10, 2012

I can't seem to find the SYSVAR that controls insert to 0,0,0 instead of pick on screen..

Quad Core 2.3GHz Intel, 64-Bit, Win 7
16GB Ram, 2GB Graphics Card
256GB SSD

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: CANNOSCALE Value Needs To Match Existing Named Scale

Jan 18, 2012

The crux of the matter is that the CANNOSCALE value needs to match an existing named scale.  This lisp is part of a bigger lisp and I need to pass a variable into it.  Here's what I have:

(setvar "CANNOSCALE" (strcat "1" = " (rtos variable 2 0) "'"))

But I get this error when I try to run it.

; error: bad argument type: numberp: nil

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Match Properties In Reverse Pick Order

Aug 17, 2011

Normally when applying the matchprop command in CAD, one has to first pick the template element, and then select the elements which should have this template element's properties copied to/matched.

is it possible (via lisp perhaps?) to reverse this order, so that i can select a bunch of elements (e.g. through the quickselect icon) and THEN apply a matchpropertieslisp command, then select a single template element which the initially selected elements should mimic?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Zoom Extents For All Tabs

Mar 10, 2009

I'm currently working in a drawing that has 148 layout tabs and I frequently work in drawings with more tabs than that. when I switch tabs, I like to see everything in the tab. Is there a lisp that will do a zoom extents in every tab so I don't have to manually do it all the time?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Autosave After 20 Commands Except Zoom

Dec 18, 2012

I just started learning LISP yesterday, as our office needs an autosave LISP. People have requested it and I have to do it...

How I wanted to do it:

The LISP will be loaded on every PC of every person with AutoCAD.

On startup "command_count" will be on 0

When using a command like plinie this happens: (+ 1 command_count)

Commands like zoom, undo etc will be ignored

When command_count reaches 20 it executes the qsave command

If using the qsave command it resets the command_count to 0

Thats my not working LISP atm:

(defun c:losave ()(setq command_count 0)(+ 1 command_count)(if command_count 10 "_qsave"));(if command "_qsave" setq 0);(if command "_zoom" (- 2 command_count));(if command "_undo" (- 2 command_count));(if command "_qsave" (* 0 command_count));(setq command_count (+ 1 command_count))

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Changing XREF Layers In DWG

Oct 1, 2012

How to edit this string so that it would change ONLY XREF layers in a dwg. to color 3 bylayer, and leave all of my additional layers in the current dwg. as is.

^C^Cchprop;(ssget"x");;color;bylayer;;-layer;color;3

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Alert When Xref Is Moved?

Jun 29, 2013

I'm new to the programming thing, and this one has me stumped.  We have a problem with people accidently dragging xrefs.  The simple solution would be to put all of the xrefs on a locked layer, but I was vetoed on this suggestion.  I've been trying to figure out if I can write a lisp that will do one of the following: Give an alert if an xref is moved.Not allow an xref to be moved.Tell the user when they open a drawing that an xref is not at 0,0,0 insertion point.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Renaming Xref Using Code

Jun 18, 2013

This lsp was passed on to me from a colleague but he doesn't know where he got it. It does a useful procedure of placing each xref, residing in the drawing, to a unique layer. The layer name is derived from the xref name. I would like to edit this to take only part of the xref name. This system I work with requires all files to have the job number as a prefix eg LE1399901_Contours.dwg, so the xref name would be LE1299901_Contours by default. I want to remove the first 10 characters to be left with "X_Xref-Contours" layer name using this code.

(defun dxf (i a) (cdr (assoc i a)))
(defun c:lxr ( / ss cnt xrs en ed bn xp xbn )
(setq ss (ssget "x" '((0 . "INSERT"))))
(setq cnt 0)
[code]........   

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: XREF Rename / Repath

Nov 25, 2012

what i would like to do is rename (externally) and repath about 4-8 xrefs in a drawing set of about 100 drawings. 

you may ask why? it is because we are trying to establish a template set of drawings for a civil design office. and when we start a new project, copy over the drawings to the relevant project folder, change the project number, run the script across the drawings and go from there. I've also tried this using the reference manager, but it doesn't work when you change the name of the xrefs (loses association)

basically i know if i could use a lisp i would run it using autoscript or something equal. All i need is to figure out the code to change the project number in the xref

for example

current - "xxxx-PN009999-aaa-00-survey.dwg"
change to - "xxxx-PN001234-aaa-00-survey.dwg"

from my research so far, the easiest way is to make a lisp with the following

-rename
b
xxxx-PN009999-aaa-00-survey
xxxx-PN001234-aaa-00-survey
-xref
p
xxxx-PN001234-aaa-00-survey
c:acadcivildummyfolderxref

If this is the correct code, do i have to rename the CAD xref files in explorer first?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Freeze All Xref Layers?

Apr 24, 2013

I have the following code that works, most of the time.  Actually, it works or completes itself all the time, but there is no "all encompassing" measures incorporated.

All of the reference entities, believe it or not, are on layer "0".  There are also some consistent layers, that you can see in the code below.  However, a user may create or even remove any layer in the reference drawing.  Therefore in my current drawing, I may have layers that are not frozen in the xref.

Like i said, the following code works, but not all encompassing.

(setq filename "7102-002-950 UC10-03")
(setq FreezePRD (strcat filename "|_PRD"))
(setq FreezeSLD (strcat filename "|_SLD"))
(setq FreezeBORDER (strcat filename "|0_BORDER"))

[Code] ........

I guess what I'm looking for is to freeze all layers that begin with "7102-002-950 UC10-03|".

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw Line / Pline To Match TEXT Rotation?

Oct 7, 2011

There are a ton of lisp to match text rotation to a selected line, but not vice versa.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Zoom Into A Set Of Coordinates Depending On Selection?

Dec 15, 2011

can do a routine that zooms into a coordinate, based on input.  So for 1A, it would zoom into the coordinate for 1A.

1A = 1,1

1B = 1,2

1C = 1,3

1D = 1,4

I will try to attempt one shortly and will post it within 1 hour. 

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Zoom Extents Upon Opening A Drawing?

Nov 13, 2012

What i would like to do is have autocad do a zoom extents automatically when I open a dwg.  Is there a lisp routine that I can run to do this?  I use to have something that would do this but I started a new job and cant remember.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Passing A Point To Zoom Not Working?

Jul 25, 2012

The good news is that, if I were righting a routine that locks up AutoCAD, I'm finished.  The bad news is that I'm not.

The code below is the portion of a routine where I have the user select 2 points and then pass those points to the Zoom command and the M2P osnap.  The problem is that, when the Mid Between 2 Points osnap tries to use the first point, it returnns an "Invalid point" message, enters a loop and locks ACAD.

(defun C:ZC ()
(setq PointOne (getpoint "First point of M2P "))
(setq PointTwo (getpoint "Second point of M2P "))

[Code].....

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Lock Layout Tab

May 9, 2012

How to Lock Layout Tab.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Xref Layer Color

Aug 14, 2009

I'm looking for a lisp that will change all the layer colors of selected xref by clicking the xref and select color from the color table palette. I have a routine that would change the layer color of a selected entity other than xref.

;;Changes selected object layer to a true color
;;of chose from a dialog
box
(defun c:cvc (/ ent ent_data rgb str objlay)
(setq ent
(entsel)
)

[code]....

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Field Object Attribute In Xref?

Oct 19, 2011

Is there way get field object att in xref ?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Bind Xref Via ObjectDBX Without Opening

Feb 11, 2013

is it possible to bind an an xref via ObjectDBX without opening the drawing?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Convert Nested Xref To Regular

Nov 7, 2013

Any routine or way to convert a nested xref to a regular xref?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved