AutoCAD Visual LISP / AutoLISP :: Delete Objects In Model And Paper Space
Feb 14, 2013
Is there a quick way to simultaneously delete all objects in a layer if these objects are found across several layout tabs and model space?
At the moment, I'm getting the objects using: (setq a (ssget "X" '((8 . "Revision"))))
This finds all objects in the drawing, but if I just use: (command "_.erase" a "")
to delete them, only the the objects in the current layout or space are getting deleted...
View 2 Replies
ADVERTISEMENT
Nov 5, 2013
I've tried doing a block that automatically updates the X and Y coordinates from its moveable leader. I can get it to work in model space or paper space. But my problem is I want it to work in PS, but update with the MS coordinates through the viewport.
I can get it to update, by LISP, by picking a point and passing the points to the blocks attributes. At the moment I have a LISP when actioned it locks the viewports, activates the viewport, and asks you to select a point. Once selected it de-activates the viewport (going back into layout tab) then asks which block you want to update. Where you now select the block and it updates the coordinates. I.e. manually pick the point in MS, switch to PS and then manually pick the block. Then I have to manually modify the leader to the correct location.
I'm hoping that I can (In PS) move the end of the leader to snap to a position in MS and the coord updates to reflect the correct MS coordinates. I'm thinking that maybe this can't be done automatically and that I maybe can move the leader but I'm not sure how I can do it without running a LISP to update the block?
I'd be happy moving the leader then just running a single command and the leader coordinates updating without having to select the points and the block again.
I've attached the block showing the auto update of the attributes (fields).
View 9 Replies
View Related
Jan 24, 2013
Is there a way by which I can link a paper space block attribute to model space block attribute
In other words
Paper space as a block Title and attribute "QTY"
Model space has a block X and attribute "QTY_MODEL"
Is it possible to edit "QTY" and as a result get automatic update on "QTY_MODEL"
I am not familiar with diesel/macros yet in Acad.
Config :: Intel (R) Xeon (R) CPU E31245 @ 3.30 GHz, 16.0 GB, 64bit win7
Inventor 2013 and Vault Basic 2013
View 4 Replies
View Related
Feb 25, 2013
Without opening the drawing...
How can I iterate through and check the object type of all objects in model space? And... then delete them if they are certain types... like lines, circles, polylines, text, mtext, etc?
View 2 Replies
View Related
Dec 9, 2013
I need to count the blocks in paper space automatically. Is there any method or lisp for this.
View 7 Replies
View Related
Aug 21, 2006
Routine to build a legend in paper space
I am looking for a routine or app to pull existing MS legend symbols (inserted from the block library) from the drawing and automatically place them in a PS legend. Since I don't have a large screen and sometimes miss a symbol before running a test plot, I wish to automate the process.
I am looking for a way to populate a paper space legend with blocks inserted into the drawing for Land Desktop 2005, 2006 drawings.
I also have to replace non-conforming architectural blocks with my own, then build the legend from all drawings tabbed in the drawing file (possibly all xref drawings as well).
I liked your article on 'Selectively writing drawing blocks to any folder using VBA'. I need to brush up on my VBA 6.0 and learn VB.NET. Perhaps your code can be modified to do the task, and this would be useful to many other designers in a further article.
View 9 Replies
View Related
May 3, 2013
I'm trying to limit the activity inside a paper space's view port. Specifically text and dimension objects (our routines) as these layers inside the view port may be frozen.
How do I pragmatically get out of the view port back into paper space?
Command: _.PSPACECommand: cvportEnter new value for CVPORT <1>:Command: _.MSPACECommand: cvportEnter new value for CVPORT <2>: 1Cannot set CVPORT to that value.*Invalid*
View 3 Replies
View Related
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
Apr 12, 2012
Is there a way to change a specific attribute in a block found over x-amount of papers pace tabs?
At current I can only change one tab at a time.
View 7 Replies
View Related
Nov 26, 2012
how to delete all OLE objects from drawing by most efficient way.
There are abt 150 drawings, each has from 2 to 20 or so OLE objects which need to be deleted. OLE objects are on many paper spaces.
I tried to use qselect but it selects only what is in current space.
Would need some lisp or some other methode than all can be deleted (excluding those which resides in blocks).
Tried also yto use ssx and then erase but still it deletes only what is on current space.
Just as additional info, those OLE are all pictures, not xls files for example.
View 8 Replies
View Related
Jul 29, 2013
lisp program to delete all objects in a drawing based on Layer excluding one layer objects.
in AutoCAD.
Example : I may have 10 layers in a drawings like 1 to 10. I need to delete all objects on 2 to 10 layers.
View 9 Replies
View Related
Oct 9, 2012
Any code that will select all xrefs in modelspace and bind (insert) them?
the -xref bind command requires explicit names and if I use * it will also bind my titleblock xref in paperspace which I want to avoid.
View 9 Replies
View Related
Jul 9, 2013
I have code that will set and sae a current UCS to the front of an entity, of course, depending on the viewpoint. This is so, because we need all draft lines in front of 3D solids, such as dimensions, leaders for labels, text entities and so on (the reason for not putting these entities in paper space is another discussion ).
But I'll have on of two problems on numerous occasions:
1. The user forgets all together to run the command.
2. The user will pick the wrong entity that is in the foremost position in that view.
The code I have utilizes the following:
(setq ent (car (entsel)))
(vl-load-com)
(setq obj (vlax-ename->vla-object ent))
(vla-getboundingbox obj 'LowerCorner 'UpperCorner)
(setq LowerC (vlax-safearray->list LowerCorner))
(setq UpperC (vlax-safearray->list UpperCorner))
Then I'll analyze the X, Y and Z of both the lower and upper corners, and set my UCS to whatever is proper.
Is there a "LowerCorner" and an "UpperCorner" for all entities. I can't see "VSMIN" and VSMAX" working because the elevation of the returned coordinates is always "0,0"
View 4 Replies
View Related
Jan 2, 2014
Any routine for changing color of AutoCAD background in model space. As for changing background color we have to follow four steps namely as follows:-
1. Execute OP
2. Go to display tab
3. Go to color tab
4. Change color
A tool that directly calls the model color shall be highly beneficial.
View 3 Replies
View Related
Jun 28, 2012
Is there a way to get model space to "display plot styles" through a lisp routine or a script?
i'm currently setting up a whole bunch of custom tool palettes for the company I work for and instead of the icons displaying in their actual colour (at the moment they're green, which doesn't show up very well on the light grey background), I'd rather they show in the plotstyle assigned to the individual dwg's.
call up the page setup manager (while in model space) and click modify, you can then check the radio button to "display plot styles" in the top-right corner. But when you have around 100 - 200 blocks to change, that process can be rather time consuming and cumbersome!
View 3 Replies
View Related
Dec 28, 2013
I would like to write some sort of AutoLISP program to evenly space objects across a given distance. I have attached a .pdf file showing what exactly I mean.
I would like the program to enable me to either enter or measure (via the selection of two points) the "z" distance, to enter or measure the "y" distance, and to enter the number of objects, "n". I would then like the program to evenly space "n" objects across the "z" distance.
A program like this is, I have to be honest and say, way beyond my current capabilities.
Perhaps some initial guidance to get me going?
View 6 Replies
View Related
May 19, 2011
is there a way to COPY objects from model space to paper space? CHSPACE only "cuts" geometry. I need the same geometry stacked in both model space and paper space.
View 1 Replies
View Related
Apr 4, 2012
how it works?, the objects are yellow in model space and white on paper space??
View 6 Replies
View Related
Oct 4, 2013
I'm trying to import a drawing from a dwt file into a drawing as a new layout. This would be perfect if the model space objects associated with this dwt file would import as well.
View 9 Replies
View Related
Mar 4, 2013
Why can't I get this to work?... okay, it is being used via AcCoreConsole.exe
I get the following...
; error: bad argument type: VLA-OBJECT nil
(defun delAllLayouts ()
(vl-load-com)
(vlax-for item
(vla-get-Layouts
(vla-get-ActiveDocument
[Code]....
View 7 Replies
View Related
Feb 13, 2013
I need to delete a specific block from current opened drawing by LISP command.
for example removing XREF attached is very easy:
(COMMAND "-XREF" "D" "FRAME")
I can remove "FRAME" XREF from drawing. Now, I want to delete a/all block with "TB12" name with same action!
(command "BlockDelete" "TB12")
so, how can I delete a/all block with specific name in current drawing?
View 9 Replies
View Related
Sep 6, 2013
There are many lisp that draw offset line but what about opposite way , I have wall of double line i need to delete one of them let's say inside wall line .
why i need to do this usually when i tracing in external program like autocad architecture or Revit or archicad i just need outline of exterior and interior walls !.
is there way that can delete the offset line ?(or within range predefined in lisp to prevent interfering of lines deletion).
View 5 Replies
View Related
Nov 29, 2012
I cannot purge a textstyle out of my drawing. When I run purge nothing is available.
However if I select the style from the style dialog I am able to select delete and delete the style.
When I use the method on the style (vlax-invoke-method style 'Delete). AutoCAD states:
Automation Error. Object is referenced by other object(s)
The style is defenatly not in use but may have been used in the past.
View 8 Replies
View Related
Feb 20, 2013
i have a small lisp and i would like for it to:
when i invoke the plot command, it will first check if there is a layer state called "Temp"if "Temp" exists, then delete "Temp", then re-create "Temp", then switch layer state temporariliy to "Plot" to plot the file, and then switch back to the "Temp" layer state againbasically, the "Plot" layer state will be set based on how the drawing(s) will plot. if a user makes changes here-n-there in the drawing, when the user wants to plot, the software will save current state as "Temp", plot using the "Plot" state, and switch back to "Temp" state at the end. all i am trying to achieve is to somehow over-write the "Temp" state. below is the LISP.
(command "undefine" "plot")
(defun clot ()
(if (layerstate-has "Temp")
(layerstate-delete “Temp”)
)
[Code]....
Civil 3D 2013 SP1, Win 7-64 bit
12GB RAM
View 9 Replies
View Related
Nov 6, 2013
I have some drawing that contains PHANTOM2 linetype.
I can't delete this linetype from my drawings!
View 9 Replies
View Related
Apr 20, 2011
A plugging we use has just updated and loading double menus causing error messages prompting that menu already exists unable to load.
In my cui the menus are loaded in my enterprise as well as my main.
How do I keep the menu with the same name in my enterprise yet unload the one of the same name in my main (where it shouldn’t be) using lisp (I want to Automate this using lisp, since I'm not always in office at the same time as everyone else)?
View 1 Replies
View Related
Mar 5, 2010
I am looking for code that will delete all the properties within a DWG file.
Searching the forum, I found the following
; Remove any existing Properties
(dictremove (namedobjdict) "DWGPROPS")
However, further research (forum, testing and help system) indicates that it no longer applies to current releases of AutoCAD so my initial happiness was short-lived!
View 6 Replies
View Related
Jan 29, 2013
The below gets the block names of empty block records. The blocks may or may not be actually inserted in the dwg. In my case though, apparently they are nested in other blocks in the drawing I am working with... but it looks as if they are part of deeply nested block definitions and therefore cannot be purged. I checked a couple blocks (the code returns over 1000 in my case) it returns and there are no objects in its definition.
How can I force them out of a drawing - and hopefully reduce it's file size?
(defun NullBlocks (/ block *thisdwg* block nullblocks)
(setq *thisdwg* (vla-get-activedocument (vlax-get-acad-object)))
(vlax-for block (vla-get-blocks *thisdwg*) ;iterate block table
(vla-get-Name block)
(if (= 0 (vla-get-count block))
(setq nullblocks (cons (vla-get-name block) nullblocks))
)
)
nullblocks
)
View 1 Replies
View Related
Sep 30, 2013
I would like to use a lisp routine to open all the files in a selected folder, search for a blocks by name, delete them, purge the drawing, save and close.
Is there a routing that can be used to do this?
View 4 Replies
View Related
Oct 10, 2012
I'm looking for code to retrieve the "Paper Text Height" from the current (active) "Text Style".
View 7 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