AutoCAD Visual LISP / AutoLISP :: Disable Snap For Specific Objects Or Layer?

Nov 28, 2012

Is there a LISP code for disabling OSNAP for specific objects or layers?  An automatic disable for multileaders would be useful when fine tuning the text placement. Trouble is you need the snap for the leader end. Maybe you could disable the snap for the text grip only. 

View 1 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Move Existing Objects To Snap Grid?

Dec 22, 2012

I have a slightly unusual query that I can't seem to find a solution for elsewhere. I have an existing OS plan that is 'off grid', and would like to adjust the vertices at the ends of all the existing lines and polylines so that they all sit on a grid point, ie round all vertices to the nearest whole number. Is there a quick command or script that does this?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Erase All Points In Specific Layer

Apr 9, 2013

I have a lisp which I use to erase all points in a specific layer.

(defun cPL ()
 (setq ss1 (ssget "x" (list '(0 . "point")'(8 . "Points"))))
 (command ".erase" ss1 "")
 (princ)
)

It is working only if I have the points in the DWG. If there are no points, I receive "Unknow command DPL". Is there anything I can do in order to avoid this error?

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Quick Select All Blocks From Specific Layer?

Mar 1, 2012

how to quick select all the blocks from a specific layer (for instance XPTO) and export them along with their attributes, exactly as we do by quick selecting them and then, through AutoCAD Express -> Attribute Export Info, but in a script...

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change A Specific Attribute From Specific Block To Specific Value

Dec 7, 2011

I've had a simple lisp I've been using for years that suddenly disappeared.  It required that you identify a block name, tag name, and the value that you want the tag to be.  All of this is performed via command line, so it is scriptable.  Since I lost it, I've been experimenting with -attedit.  This command comes frustratingly close to what I'm looking for, except it only appends an existing tag, or replaces a specific string within the tag; I can't get it to replace the entire tag, regardless of its value.

1> Any lisp routine that does what I describe?
or
2> How to make -attedit replace a tag value without regard to what the value currently is (like a * wildcard)?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Move Objects To New Layer Based On Their Present Layer

Jun 20, 2012

Say I have 2 items, one is on layer "M-Duct" and the other on "M-Pipe" (they are in the same drawing). Any lisp routine that would create the layers "M-Duct-New" and "M-Pipe-New" (based on the same color and LT as the original layers) and then move those objects to the newly created layers?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change All Objects On Layer 0 To Existing Layer PC Module

May 31, 2012

I'd like to have/write a lisp to change all objects on layer "0" to layer "PC - Module"

If possible also;

save the document close the document open next in directory run layer changer program again.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Getting Objects Layer?

Feb 7, 2010

How can I get the layer that an entity is on. I have tried numerous method but they don't seen to be retrieving the layer information.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: New Layer For Selected Objects

Jan 1, 2014

I need a LISP that create a new layer and ask me for the name and the other properties (color,lw,lt..).

ask me if I want move the selected object for the new layer (yes is the default value)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Moving Objects To Different Layer Is Slow

Nov 26, 2013

I find that the command to move objects to a different layers runs very slow in one of the drawing.  I want to find out what wrong with the drawing and how to speed things up.

I have a LISP program that batch processes a large number of drawings.  One of the step to process each drawing is to change the colors of some objects according to the status of the objects.  I do this by moving the objects to a later that has the right color.  So far the program only takes 2 to 4 minutes to process each drawing.  But the program takes close to 90 minutes to process one specific drawing.  I track down the problem has to do with the command that moves the objects to the right layer, like this:
 
(vl-cmdf "_.chprop" (ssget) "" "_layer" "ABC-Prod-Good-Pcs" "")

 This command takes a very long time to finish, like 40 minutes each time it runs (to move 1200+ objects), and the program needs to run it twice for a total of approximately 80 minutes.

Please note that the drawing itself is not the largest drawing, and it doesn't have the largest number of objects to be moved either.  It is close to the top-5 drawings in term of drawing size and the number of objects to be moved. I cannot say that the drawing size or the number of objects to be moved are the cause of the problem.

I tried to "speed up" by moving 200 objects incrementally.  That didn't work. I tried to "speed up" by moving 100 objects incrementally and saving the drawing after each 100 objects are moved.  That didn't work either; actually the speed is slightly slower than simply moving 1200+ objects all at once.

I don't know what to do.  I believe there may be something unusual about that drawing.  By the way, the reason why I choose to change color by moving objects to a different layer has to do with the fact that I have found this is the best way so far. I tried to change the color of the objects directly.  But I find that the color of some sub-parts of the objects are not changed (because their color is by-layer). That's why I choose to change color by moving objects to a different layer.

How I can check the drawing, any different way to change color that is better.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Converting Objects Of Certain Linetype To A New Layer

Oct 26, 2012

I would like converting all objects that has forced linetype to be on a linetype layer.

So if there are objects that have forced linetypes - dashed/hidden/phantom, etc., those entities would be moved to a linetype layer based on their forced linetype.   The entities would all be changed to color bylayer, linetype bylayer.

So if there is a rectangle that is sitting on an EQUIPMENT layer, the routine would put that rectangle on a new layer called DASHED and change its forced linetype to BYLAYER.

Lastly, once that's done, the next and final step is to locate a the existing layers with matching linetype - say, OBJECTS with DASHED as a linetype, and merging it to that layer.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Colors Of All Objects In A Layer

May 30, 2013

Can I have a lisp to select all objects in the layer "Defpoints" (including model and paper space, and including objects inside blocks) and change the color of those objects to color 30?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Delete All Objects In All Layers Except One Layer?

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

AutoCAD Visual LISP / AutoLISP :: How To Find Snap Errors

Jun 9, 2004

how to check snap errors in drawing in a specified layer against some other layer. means first layer should end with second layer otherwise place error.both layers have linear features.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Snap To Centroid (massproperties)

Apr 9, 2010

Any way to snap to, create nod, or almost anything to the centroid of a region. I create a region then have to go to massproperities then polyline command then highlight the x value and right click and paste to cmd line then the y value the same way. If there is a way to shorten the process that would be great.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Customise Snap Commands To F Keys

Feb 10, 2009

Im using AutoCAD 09 for the first time and need to find out how to customise my snap commands to F keys. I've been using 2004 and it was really easy. 09 seems to not allow it?

for example i set F4 to end point and F5 to intersection point etc. it saves using O snap or a tab. just L, F4 and its done (for example)

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Disable Command MOVE On Reactor?

Feb 7, 2012

I use the following code to assign a reactor to an object:

(setq marReactor (vlr-object-reactor (list (vlax-ename->vla-object oggmar)) "TEST" '( (:vlr-erased . reactor_upd) (:vlr-modified . reactor_upd) ) ))
 
"reactor_upd" is the name of the function that starts every change or delete the object.

I would like to exclude the command "MOVE", ie if I move the object, I do not want that part to the"reactor_upd" function.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Object Enabler - Any Way To Temporary Disable It

Feb 28, 2013

I have an Object Enabler question... is there anyway to temporily disable them - but without Programs And Features > Uninstall?

I know that most enablers add an entry in Appload. What about a button that unloads the enabler if its name can be determined?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Delete Specific Block

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

AutoCAD Visual LISP / AutoLISP :: Filter For Specific Attribute Tag

Aug 30, 2011

How would one modify

(= (cdr (assoc 0 data)) "ATTRIB")

in order to filter for a certain attribute tag named MYTAG

I am working with a custom LISP routine which reports out to a CSV file, an attribute extraction file - but I need my routine to ONLY evaluate blocks which have the MYTAG attribute tag. Then, if it passes that first check, it evaluates another list of Tags within those blocks - a list of tags which I have specified elsewhere in the code.

I am trying to modify my existing code as little as possible, and I think that if I do it at the line (which I've pasted above) - that will "pre-qualify" my selection set....

ATTACHED LISP IS THE FILE I AM WORKING WITH --- THE ACTUAL LINE I WANT TO MODIFY IS AT:

"(while (eq ENSUB "ATTRIB")"

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Make Block Which Is Visible To Snap Only On Special Point

Dec 27, 2011

I want to make a block which is visible to snap only on a special point, say pivot point.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Creating New Drawing With Specific Template

Sep 20, 2013

I have some code that starts a new drawing with a specific template from a lisp routine

(defun ghd:load_newdwg (template / ae-acad-object newdwg)
  (setq ae-acad-object (vlax-get-acad-object))
  (setq newdwg (vla-add (vla-get-documents ae-acad-object) template))
  (vla-put-activedocument ae-acad-object newdwg)
)

The template location and file is stored in variable clienttemplate (and is not the standard template path set under options). All works okay except if I close the new drawing, when I return to the previous drawing that was current when the new drawing was created (i.e. the drawing that the routine was run from). I get the following error:

Command: ; error: Exception occurred: 0xC0000005 (Access Violation)
; error: Unknown exception occurred
; warning: unwind skipped on unknown exception

I assume this has something to do with the original routine not closing/finishing before switching to the new drawing. This is the last line of the routine:

(cond ((= startnewdwg 1) (ghd:load_newdwg clienttemplate)))

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Put Circle To Line After Specific Length

Oct 3, 2013

I need a lisp which is i can draw a line or pline with circle in every 30 meters ( circle diameter and total line or pline length will be optional )

View 6 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 :: Create Polygon Viewport At Specific Scale

Apr 25, 2013

I'd like to run one command that allows the user to draw a polygon viewport then sets that VP to 1/8"=1'-0".

It can be nearly accomplished with a macro, but falls just short because the polygon vp requires an unknown number of clicks, so there is no way to know how many pauses for user input in the macro.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw An Ellipse At A Specific Point On A Drawing

Mar 18, 2008

I need to draw an ellipse at a specific point on a drawing.

i can calc the major and minor and i have a polar point of where it should be drawn.

i just need the code to draw the ellipse.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add Sequential Number As Suffix To Specific Attribute?

Nov 11, 2011

I currently have a LISP routine that will replace the value of a specific attribute name with sequential numbers in the order that the blocks are selected. Like TCOUNT for attributes - and it only looks for a specific attribute Tag Name called "ID".

However, what I want it to do now, instead of just putting the number into the attribute value, I want the number to be a suffix to the existing default tag value of the tag named "ID" which is "ADDRESS:" for some blocks and "ELEVATION:" for other blocks but the tag name that the routine always has to filter for is "ID". That way the user can pick anywhere on the block - not being forced to pick the tag we want to add numbers to.

What I need the new LISP to do is append a space and then a number to the existing tag value in the block, so that the result would look like "ADDRESS: 1", "ADDRESS: 2", "ADDRESS 3" or "ELEVATION: 1", ELEVATION: 2", etc. depending on whatever the default value for the tag "ID" is.

there are several hundred different block names - but they all have a Tag Name of "ID" - whose default value is sometimes "ADDRESS:" and sometimes "ELEVATION:".

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: SSGet Specific Dynamic Block / Since They Are Anonymous

Sep 19, 2011

If you do a LIST command on a dynamic block... AutoCAD tells you the Block Name as well as the Anonymous Block name.

How can I use ssget to snag all Dynamic Blocks that use the 'Real Block'?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Print Specific Variable To Text File?

Apr 5, 2013

I'm looking for a way to find out what all plot styles are set in drawings in a sheet set.

We are transitioning from color based pen settings to style based and would like to be able to export a log that shows the variable PSTYLEMODE for each drawing in a sheet set. I plan on using ScriptPro to run it on the full sheet set.

Civil 3D 2013
Windows 7 64-bit
Xeon W3550 3.07 GHz
Nvidia Quadro 4000
12.0 GB RAM

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine To Delete Specific Blocks From Drawings?

Aug 25, 2005

I need a LISP routine that could delete specific blocks from drawings. I have over 100 drawings, each having 4 blocks that I need to get rid of.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Convert Fields Into Text In Specific Attribute Tags

Jan 6, 2014

Convert Fields to text in my Title Block. I want to change some specific attributes only to convert into texts in my title block ( "MODE_A3" is my Title Block name).

For example in "MODE_A3" block having lots of tags like TAG1, TAG2, TAG3 upto TAG10 with fields. I need to change TAG3, TAG4, & TAG5 attribute fields into texts in all layouts.

View 6 Replies View Related







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