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


ADVERTISEMENT

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 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 :: File That Create Layout For Each Layer?

Apr 13, 2013

Lisp file that create a layout for each layer,I’m looking for a lisp file that creates layout for each layer instead of doing this manually.

Software: AutoCAD 2014, AutoCAD C3D, AutoCAD M3D, Revit
Windows 7 (Ultimate 64 bits),
Firefox 20.0,
Kaspersky 2013.

View 7 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 :: 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 :: Edit Single Attribute Value

Oct 30, 2012

I want to edit 1 attribute value in a block to number all my blocks (eg A001, A002, A003...) (example picture attached)

I know about the at tout and at tin but I need a lsp routine that only changes one attribute value without having to double click and go through that.

i attached a lsp routine, how to edit and remove everything except the value part.

View 9 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 :: Lock Layout Tab

May 9, 2012

How to Lock Layout Tab.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Best Way To Increment A Single Attribute In A Block?

Aug 25, 2011

I have a series of blocks that I need to insert into a drawing, maybe 100-200 times and then change one of the 6 attributes by an increment of 1.

I've looked at some of the older posts and have not been able to do this. Is it possible to take the tag regerence, in this case OUTLET_REF and automatically add 1 to it when the symbol is inserted.

Can this be done using Diesel or with a bit of lisp?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Repeating Break At Single Point

Nov 7, 2011

I'm creating the following macro:- (defun C:BK () (command "_BREAK" PAUSE "_F" PAUSE "@" )(princ)) to add to a shortcut key lisp file and then I want it to repeat... How do I make it repeat?

I want it to do the same as this:- *^C^C_break \_f @ but as a shortcut key in a lisp format.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Make One Single Block Containing All Entities

Aug 16, 2013

I have a lisp that draws variety of entities such as lines, arcs, hatches, points, blocks, text etc. How can I make one single block containing all of them, i.e. one block that has all items drawn since the lisp was invoked.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Retrieve Length Value Of Single Entity

Feb 27, 2012

When we launch the list command, the Area system variable holds the area value of the selected shape.

How to get the length value into an Autolisp program to use it?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Plotting All Layout Tabs

Jul 22, 2004

Any lisp file that can plot all of the layout tabs? I am looking for one that will plot to a plt file and also pdf?

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Field Link To Layout Tab

Dec 5, 2007

Is there any way to grab the Object ID or name from a layout tab to use in a field? I wish to link the layout name to a callout block so that if the layout tab changes position and name (inserting a new tab), the call out block will update no matter what page it is on. Without using the Sheet Set manager.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Apply Single String Value To All Layers In Drawing

May 30, 2012

Is there a way to apply a single string value "Phase1", or "Phase2" to all layers in a drawing?  I though about exporting a Layer State, modifying it in Excel, then re-importing the layer state, but, Layer States don't store a value for "Description." 

I'm creating a consolidated map from several drawings, but I'd like to be able to separate the layers from each drawing.  Description seems like a good value to populate and be able to sort by in the Layer Manager.

View 3 Replies View Related

AutoCAD 2010 :: AutoLISP For Combining Layout Tabs Into Single PDF File?

May 8, 2012

AutoLISP for Combining Layout tabs into single PDF file?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Mtext String In Group 1 Does Not Match Text Shown Or In Property Window

May 17, 2012

I have a routine that looks for an MText date stamp and replace the old date with a new date.  The problem is some MText strings appear encrypted.  Below is an example:

{\H1.121x;\C1; \LFY 2011-12\l \H0.6252x;04-30-11} This is what I should get when I extract the string (as shown in Property window)

(1 . "\pxi-2.1818,l4.3636,ql,t4.3636;{\fSymbol|b1|i0|c2") is what I get when I extract the group code.

I'm running AutoCAD 2012 on Windows 7.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Moving Object From Layout To Another Programmatically

Dec 14, 2011

how to do this programmatically and without modifying the handle of the object,i am trying to do it programmatically (entmod (cons 410 newname)(assoc 410 ... no luck.

(entmakex -ing will modify or create a new handle ctrl-X and then ctrl-V recreates a new handle too ...

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Find Offset Origin Of Layout

May 8, 2013

I want to know the correct way to find the offset origin of a layout in an AutoCAD drawing.  Let say I have a drawing that has many items on it.  And I create a layout showing just the items in the lower right corner of the drawing.  I want to know the offset origin of this layout relative to the Model space.

I came across some LISP commands that are supposed to do just that:
 
(vl-load-com)(setq activelayout (vlax-get (vla-Get-ActiveDocument (vlax-Get-Acad-Object)) 'ActiveLayout ))(setq activeplotorig (vlax-get activelayout 'PlotOrigin)) 

Unfortunately, the commands don't seem to work because it always returns (0.0 0.0).  That cannot be right.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Entname Of Last Block Added PER LAYOUT?

Dec 5, 2013

Is it even possible to get the entity name of the last block added to a layout? I need to find the entity name of the last block added to each of three layouts. 

Previously I was using entlast but obviously that will not descriminate per layout.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Layout List In Reverse Order

Jun 7, 2013

I need to get the layout list in reverse order. How to do this? My plotter outputs prints face up and I wind up with a stack of drawings in reverse order - If I can cycle through the tabs in reverse order they will wind up in the correct order in the print room!

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Pause To Allow User To Select Layout Tab

Sep 13, 2011

I need a command that will allow the user to select a layout tab.  I thought the following would work, but it just ends the LISP program:

(command "layout" "s" pause)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Select All Viewports In Drawing / Get Name Of Layout

Sep 29, 2013

I need to select all the viewports in the drawing and to make some changes with them, I'm planning to select them all with ssget command. If I do that I will have one viewport for the paperspace itself in every layout. One of my question is, how to know which viewport is the paperspace itself?

Second question is, how to get the name of layout in which one is the viewport? It is important to me that the lisp is really fast, so I'm planning to do the most of stuffs with vla commands.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: True Coordinates Start And End Of Layout Page

Mar 28, 2012

I’m trying to create a view port, which covers my entire layout (white/ page area) using the following command
 
(command “mview” ‘(0 0 0) ‘(297.5 210 0))

However as you will note 0,0,0 is not the very edge corner of my layout (white area) and my white area is smaller then 297.5x 210mm (standard A4 landscape size)

How to obtain the exact measurements and starting coordinates to fully fill my entire layout page (white area)?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get List Of Layout Tabs Without Vla Or Layoutlist Functions?

Mar 6, 2013

okay, I need a way to get a list of layout tabs without vl-, vla-, vlax, or LAYOUTLIST functions. Why?  You ask?

This is for lisp funct that will run in AcCoreConsose. Apparently the console doesn't yet support these.

Also, need a way to check Effective name of dynamic blocks without vl-, vla- or vlax- funs also.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Block In A Specific Layout Using Function

Jan 28, 2012

I would like to insert a block in a specific layout (eg. "LAYOUT13") using the function vla-insertblock

I have already searched the web and this newsgroup but have not found the solution.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Display Paper Size Of A Layout In Block

Dec 20, 2011

I'm trying to display the papersize of a layout in a block. So far I've looked into diesel and field expressions.

With field expressions I can get the name of the papersize to display that's too long(OVERSIZE: ISO A1), I need only the last two letters.

View 5 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 :: Routine For Multiple Paper Space Layout Tabs

Nov 25, 2013

Any LISP routine that can create multiple paper space layout tabs and can name them incrementally. I have a template and I wanted to copy tab2 of my layout multiple times and name them incrementally. I have a code shown below that comes close to what I need it to do but it creates a "New Layout" instead of copying the tab I need it to. Please see code below:

(vl-load-com)(defun c:LAYOUT+ (/ *error* prefix i n acDoc oLayouts layoutName) (defun *error* (msg) (if acDoc (vla-endundomark acDoc) ) (cond ((not msg)) ; Normal exit ((member msg '("Function cancelled" "quit / exit abort"))) ; <esc> or (quit) ((princ (strcat "
** Error: " msg " ** "))) ; Fatal error, display it ) (princ) ) (if (and (setq prefix (getstring "
Enter layout name prefix: "))

[Code] ......

View 7 Replies View Related







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