AutoCAD Visual LISP / AutoLISP :: Layer State Delete
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
ADVERTISEMENT
Jul 31, 2012
A quick way to apply a Layer State to multiple DWGS?
View 4 Replies
View Related
Nov 2, 2011
I have 2000+ drawings that have either the layer state "LMAN_DWF" or "DWF". I want all of them to read "DWF" for scripting purposes. LSIP routine that will go into a drawing and change rename a layerstate if it is named incorreclty, but do nothing if it is named correctly?
Does Layer State "DWF" exist?
If Yes, skip file and move on to next file
If No, does Layer State "LMAN_DWF" exist?
if Yes Rename Layer State to "DWF"
If No, skip file and move to next file.
Or a LSIP routine that can simply dump a list of all drawings in a directory that contain "LMAN_DWF" as a layer state. I could then use that list to do a simple script to change the layer state names on those specific files.
View 2 Replies
View Related
Aug 8, 2013
we have a good size project going on with lots of view ports of a base map (floor plan or site plan). Then we set the viewport layers the way we would like it, but along the way, we keep getting updated base maps (floor plan or site plan) with new layer created in them. These newly created layers are for the originator and will not affect our project.
Is there a way to have our project set to ignore any newly created layer from the originator of the base files? That is, we have our project (viewport layers) set the way we want it. When we get an updated base file, replace the xref(s), our layer state will still be the same, ignoring any newly created layer, automatically. I sure hope I am clear enough here.
Our problem is that when we get a new base file, then we would have to go to every file that has a viewport related to this new base file and turn off the new layers.
AutoCAD 2014
View 1 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
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
Jan 2, 2014
(Part of a table that shows the block in the first column the block name in the second and the count in the third)
(IF (SETQ ss (SSGET "x" '((0 . "INSERT") (2 . "PoolLight,`*U*") (410 . "Model")))) ;| <- Just an example the full blocklist is much longer and not all are dynamic |; (WHILE (SETQ Ent (SSNAME ss 0)) (SETQ BlkName (CDR (ASSOC 2 (ENTGET Ent)))) (IF(SETQ tempList (ASSOC BlkName EndList)) (SETQ EndList (SUBST (CONS BlkName (1+ (CDR tempList))) tempList EndList)) (SETQ EndList (CONS (CONS BlkName 1) EndList)) ) (SSDEL Ent ss) ))
getting the visibility state name for each instance of a dynamic block. The blocks display properly with the count, but the block name displays the Uname - *U59, *U61, *U66, *U68, etc...
(Also, why LISP created tables always seem to force a Title or Header no matter how I try to supress it?)
(VLA-PUT-TITLESUPPRESSED TblObj :VLAX-TRUE)(VLA-PUT-HEADERSUPPRESSED TblObj :VLAX-TRUE)
Both seem to have no effect. If I don't include one extra row to the table then it fails to populate all together.
View 3 Replies
View Related
Aug 9, 2013
toggling ribbonclose and ribbon but that did not answer my question. I'm using AutoCAD 2014 and there is a setting to either toggle through all ribbon states or you can select one. You can cycle through:
Minimize to Tabs
Minimize to Panel Tiles
Minimize to Panel Buttons or
Cycle Through All
I want it to always minimze to tabs but when I close CAD and re-open it doesn't remember that selection and always cycles through all minimized states again.
I don't see any system variable or registry value that seems to save this. how I can make it remember?
View 2 Replies
View Related
Feb 15, 2013
When scanning the BTR (Block Table Records) and encounter a "*U" block definition
how can i know if it relate to dynamic block and have it's name?
acutally my current goal is:
when insert a dynamic block at default state (no change in it's dynamic properties/actions)
it's 'Name and 'EffectiveName is equal, when set some of it's properties it turns to dynamic anonymous
with Name = "*Unn"
Can i programaticlly set the block reference to be dynamic anonymous (with out setting any of it's properties)
cause i would like to modify it's BTR (with out effecting the original BTR dynamic block) but do not want to convert it to static anonymous block.
View 2 Replies
View Related
Nov 1, 2013
I have 4 Dynamic Blocks with the same name, but each are on different layout pages. I need to change the visibility state of all 4 to the same value. So far every attempt of mine has failed.
My process at this point is to: build a selectionset of all 4 Dynamic Blocks with the same effective name, convert the selectionset to a list of entity names, then use a foreach to change the visibility states one at a time. Currently, I get "error: bad argument type: lselsetp <Entity name: 7ffff7b6c90>". <Entity name: 7ffff7b6c90> is the entity name of the first block in the list. I'm guessing it's because the block is found on a non-current tab
(defun chgdynprop (e propname newval / obj v vval sal tot i) (setqobj (if(= (type e) 'vla-object) e (vlax-ename->vla-object e))) (if (= (vlax-get-property obj
View 3 Replies
View Related
Dec 24, 2013
I currently insert certain dynamic block into drawings with a short function that first inserts the specified dynamic block and then immediately changes the visibility state to one specified as an argument to the function.
I'm wondering if it is possible / better / faster to somehow insert the dynamic block with the decided visibility state simultaneously. I've been amazed by many capabilities of VL so I wouldn't at be surprised if this can be done. (the dynamic blocks I'm inserting could have many multiples in the drawing but I need this method to only affect the one being inserted at the time the function is called. I currently use entlast to decide which one is being inserted.)
View 6 Replies
View Related
Oct 6, 2011
I have created a bunch of templates (title block type drawings) for my company. In these templates there is a dynamic block used for a particular note. Based on customer number, this note will be changed.
We have a program that will insert the correct template based on the drawing type. It will know the customer number and change the dynamic block visibility state to reflect the correct text in the note.
Here's the problem; I don't know why, but sometimes the visibility state does not change. It's not the code as it works just fine in some drawings.
I've gone in and just changed the visibility state name, then changed it back, then saved the drawing and it worked. In some cases, I've also just gone into the template and deleted the dynamic block and re-inserted it, and it began to work again.
Having trouble with dynamic block visibility states not working when using an automated process?
View 2 Replies
View Related
Jan 24, 2013
I have a dynamic block with several visibility states, and each visibility state has one invisible-constant attribute. I can't seem to wrap my head around dynamic blocks well enough to get the value from the active visibility state invisible constant attribute. I know how to get the visibility state like this:
(setq ss (ssget "_x" (list '(0 . "INSERT") '(2 . "`*U*,<DynBlockName>") (cons 410 (getvar 'ctab)))))
but what next?
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
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
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
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
Mar 10, 2004
I am trying to create a lisp to delete all the empty layouts from mydrawings. I do not see any code to control this.
View 8 Replies
View Related
Aug 19, 2012
I have list like (C:projectspr0310.dwg C:projectspr0315.dwg C:projectspr03drawings17.dwg)
Want these three files deleted from C:projectspr03.
View 9 Replies
View Related
Sep 9, 2011
trying to delete a file every time CAD is fired up and/or a new drawing is opened. i cannot make it work so far. planning to incorporate it into acaddoc lsp file.
(defun deletestupidfile()
(vl-load-com)
(setq myname (getvar "loginname"))
(if (= (getenv "PROCESSOR_ARCHITECTURE") "AMD64")
(progn
[code]...
View 5 Replies
View Related
Apr 26, 2012
I got a model-file with several layout tabs and I want to delete a block in all layout tabs.
View 9 Replies
View Related
Feb 15, 2013
I have a company .cuix menu that is loaded as a partial menu to the main acad.cuix file. I want to delete all the toolbars and pull down menus associated with it and leave the other stuff in place. This is in Autocad 2011 but should also translate to 2013. So far, I have tried opening the CUI menu, going to the company.cuix partial menu and deleting the toolbars. Then I hit save, then Apply. Toolbars disappear and pulldown menus go away. But when I reload AutoCAD they come back.
View 1 Replies
View Related
Nov 8, 2002
Is there any utilities that can select the entire drawing with the 2d polyline and erase all the polyline less than specify length (eg:10m,20m etc) ?
View 4 Replies
View Related
Dec 6, 2007
I have a program that makes 3d polylines from various data. That 3d pline then gets added to a civil 3d surface as a breakline. I want to modify the pline with my program, but preserve the handle, as I think that is what C3D uses to decide if its part of the surface. I tried this as a sample with no luck:
;DELETE 3RD VERTEXT FROM 3D PLINE
(DEFUN C:T3 ( / EN ENAME ENT ENTL)
;GET 3D PLINE
(SETQ ENT (ENTSEL "
Select 3D Pline:")
[Code] .....
I know you can modify a vertex, but what about add and delete with entmake and entmod? I also considered using activex for this task, but you can only add verticies from what I could tell in the object browser of VBA, not delete them.
What I will be doing is deleting all the verticies and adding back the correct ones. Or if there was a way to transfer a handle to a new entity after deleting the old, that would suffice too.
View 9 Replies
View Related
Dec 2, 2010
I need a lisp routine which will delete all the dimensions inside selected block or blocks, including nested blocks inside.
View 9 Replies
View Related