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
ADVERTISEMENT
Sep 26, 2013
I have the below code, which works great accept if the layout tab doesn't have a viewport.What am I missing?
(defun ViewportLayerUpdate ()
(setq OLDcmdecho (getvar "cmdecho"))(setvar "cmdecho" 0)(setq OLDnomutt (getvar "nomutt"))(setvar "nomutt" 1)
(if (setq ss1 (ssget "X" (list (cons 0 "VIEWPORT"))))(if (setq ss (ssget "x" '((0 . "VIEWPORT") (-4 . "/=") (69 . 1))))
(command "CHPROP" ss1 "" "LA" "0-VPRT" "") ))
(if (setq ss1 (ssget "X" (list (cons 0 "VIEWPORT"))))(if (setq ss (ssget "x" '((0 . "VIEWPORT") (-4 . "/=") (69 . 1))))
(command "change" "p" "" "p" "color" "bylayer" "") ))
[code]...
Factory Design Suite Ultimate 2012
AutoCAD 2012 | Inventor Professional 2012 | Vault Professional 2012
View 3 Replies
View Related
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
Mar 7, 2013
I want to insert another drawing layout tabs contents in current drawing.
It's easy for MODEL tab, but for LAYOUT tabs, I dont know how!?
I prepared a code for INSERTING MODEL tab in current drawing:
(defun INS_DWG (TAB path dwg P / blk)(setq blk (strcat ""*" path dwg """));(setq N (vla-get-count (vla-get-layouts)));;Number of LAYOUT TABS in dwg(if (or(= TAB 0) (= TAB nil))(command "INSERT" blk P 1 0)); TAB=0 or omitted ==>Insert MODEL;(if (= TAB 1));==>Insert the 1st LAYOUT in dwg file;(if (= TAB 2));==>Insert the 2nd LAYOUT in dwg file;and so on....);;;usage:;;(INS_DWG 0 "c:\test\" "test.dwg" '(0 0))
View 8 Replies
View Related
Mar 6, 2013
(layoutlist) ... returns a list of strings of the layout tabs in the drawing.I've used this ages... Isn't it a core lisp function, or is it coming from express tools or somewhere else?
View 5 Replies
View Related
Dec 7, 2011
Is there a lisp for automatically draw a pline in model space of the projection of all existing paper space viewports, without need to select one by one? It will be also interesting if the lisp automatically create a specific layer like "ProjectViewport" to draw this plines. I am working with autocad 2009.
View 8 Replies
View Related
Dec 27, 2013
Here is the lisp I am attempting to use:
(defun c:ada ()(setvar "cmdecho" 0)(command "-layer" "t" "*" "on" "*" "s" "0" "f" "*" "t" "*ex_*" "t" "*all_*" "t" "rev*all*" "t" "*prop_*" "f" "*geo_*" "f" "*util_*" "t" "*grd_*" "t" "rev*grd*" "f" "*z_*" "f" "alt*" "f" "*grd_elev*" "")(command "_vplayer" "f" "*grd_elev*" "c" "t" "*grd_ada_*" "c" "" "") (setvar "cmdecho" 1))
The purpose is to show the proposed grading plan at a smaller scale so that we can give detailed grading plans to meet City Regulations per ADA codes. I understand that this can be accomplished by blocks and attributes, but when you have hundreds of spot elevations that can become cumbersome and less customizable than mtext. The large scale drawings can not have all of the spots shown or it would be too cluttered. But I want to be able to see all of my elevations when I am working in model space to ensure that all of my leaders and spots move together.
View 9 Replies
View Related
Aug 29, 2012
I have a problem that I cannot seem to solve. I have a drawings with a whole bunch of layout tabs that have a few viewports in each tab. One of these viewports on each layout tab is on the layer VIEWPORT. I did this so it would be easy to filter out the other viewports in the drawings. I am using the code below to change all of the viewports with the layer VIEWPORT to the Custom Scale 0.020833. This works for all of the layout tabs except the first tab. It will not for some odd reason work on the fist tab.
(setq vieportfilter (list (cons 0 "VIEWPORT")))
(setq ssetvp (ssget "x" vieportfilter))
(setq cntrp 0)
(while (< cntrp (sslength ssetvp))
[code]..........
View 1 Replies
View Related
Jun 25, 2012
Any routine to re-size viewports in multiple layouts? We have to re-size viewports as they were created a little too small and are now spread across almost 1000 drawings in 18 dwg.
View 6 Replies
View Related
Jun 24, 2013
I am in need of a LISP to freeze layers in viewports on named pages. I found the following functions to return the frozen vport, but it only returns the list of already frozen and it only works if the viewport is active; besides just listing the frozen layers isn't enough. I need to be able to supply the page/tab and a list of layers to freeze.
; by Jürg Menzi 1999(DEFUN GetFrozenLaysInVport (/ LayLst) (FOREACH memb(GetMviewInfo) (IF(= (CAR memb) 1003) (SETQ LayLst (CONS (CDR memb) LayLst)) ) ) (REVERSE LayLst))(DEFUN GetMviewInfo (/ ActVpt CurSet IDX RetVal TmpVal) (SETQIDX TActVpt (CAAR (VPORTS)) ) (IF (OR(= ActVpt 1)(= (GETVAR "TILEMODE") 1) ) (SETQ RetVal nil) (PROGN (SETQ CurSet (SSGET "X" '((0 . "VIEWPORT")))) (WHILE IDX(SETQ TmpVal (ENTGET (SSNAME CurSet 0) '("ACAD")))(IF (= (CDR (ASSOC 69 TmpVal)) ActVpt) (SETQIDX nilRetVal (CDR (ASSOC "ACAD" (CDR (ASSOC -3 TmpVal)))) ) (SETQ CurSet (SSDEL (SSNAME CurSet 0) CurSet))) ) (SETQ CurSet nil) ) ) RetVal)
Is it possible to provide the page/tab name and a list of layers as aguments to a subfunction that could either activate the viewport and freeze a list of layers, or simply freeze the layer list for the named page's/tab's corresponding vport.
Important: most of my pages/tabs contain at least two vports. The largest of the two vports is the only one I wish to change, but if the layer list is frozen on all vports (per page/tab) it will make no difference because the smaller vport only requires that layer 0 is visible.
View 6 Replies
View Related
Nov 8, 2013
I'm creating a drawing set that has over 100 sheets with varying amounts of viewports on each sheet (from one to four). Each sheet is its own file, so there is only one layout per file. For each section of the drawing set, the viewports will have the same layer state.
Is there were a way to update the layerstate of each viewport through a batch LISP routine? This would save me DAYS in opening each file, importing the layer state, and restoring it for each viewport. It seems straight forward, but I have no idea where to start with batch routines.
View 4 Replies
View Related
May 9, 2012
How to Lock Layout Tab.
View 3 Replies
View Related
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
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
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
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
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
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
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
Jun 19, 2013
Trying to add this macro to a new command in my cui. Does Select all not work in macros?
^C^Clayiso;;_select;all;;_chprop;la;c-rway-x;;
View 8 Replies
View Related
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
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
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
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
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
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
Jan 2, 2012
with a function like this I added some xdata, some MULTILEADER
(defun c:add_xdata () (princ "Select: ") (setq ogg (car (entsel))) (addXdata ogg "TEST" "CODICE" "1256") (addXdata ogg "TEST" "MATERIALE" "LEGNO") (addXdata ogg "TEST" "TIPO" "A"))
Now with the following function can only select leaders who have linked the xdata application TEST
(setq selez_all (ssget "X" '((0 . "MULTILEADER")(-3 ("TEST")))))
I can not, however, find a way to select all MULTILEADER who have a particular value of XData.
For example I would select all MULTILEADER with MATERIALE = "LEGNO" and TIPO = "A".
View 4 Replies
View Related
Feb 11, 2013
Newbie here trying to learn LISP. My first program is to flip all arcs and circles that have a Normal Z property of -1. But I'm having trouble finding a detailed list of commands and functions for the LISP language that explain creating circles to selecting entities filtered by properties. I must be searching for the wrong terminology.
View 9 Replies
View Related
Apr 10, 2012
I have the following code, that for some reason the last created dimension is no being selected. That's the first problem. The second (and not as improtant) problem( becasue it does work), is that I'm using the "dimedit" command. I prefer to do a swap within the dxf codes, that I treid but didn't work, so I resorted to the "dimedit" command.
(command "DIMLINEAR" pause pause pause)
(setq last_dim (entsel (entlast)))
(setq oldunits (getvar "lunits")) (setq oldprec (getvar "luprec"))
[Code].....
View 4 Replies
View Related
Jun 20, 2012
is it possible select all ANNOTATIVE objects in a DWG and to set a Viewport/ANNO scale for all via lisp
View 3 Replies
View Related
Jun 21, 2013
using autolisp or visual lisp I want to open "Select Color Dialog Box" URL....and get RGB color code to my lisp.If I enter "color" in command line, i get color dialog box, but if I use this command in (command "color") I get more promts and not color Dialog Box.
I want to make a lisp routine which would ask for first color, second color and range of colors. And will calculate color range from first color to second color.
View 7 Replies
View Related