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
ADVERTISEMENT
Feb 18, 2013
Wblock when run from the command line used to erase the entities selected, now it seems it does not, but the dialog box shows an option to keep or erase the selected entities.
Any variable name that controls this functionality?
View 1 Replies
View Related
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
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
View Related
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
May 15, 2013
I have pieced this lisp together from a few I have come across here in the groups, but am now stuck with the final pieces. Once the pline is drawn I would like the lisp routine to select the pline (last ?) instead of the user doing so. I would then like to offset the line 1 (foot) and then erase the original line drawn, so the user does not have to.
View 9 Replies
View Related
Oct 8, 2013
I've been looking for a lisp program. I've tried to mix-and-match code to come up with a working lisp but nothing is working. I am using a polyline rectangle to start with, offsetting it out 0.75 outward, and triming everything outside of the offset and erasing the offset.
View 9 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
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
Jan 5, 2012
I have a drawing that has 2D pipeline (only x and y, z value =0) and 3 topo contour lines ( with x, y and z vaules). I need to divide the the 2D pipeline into say 2000 points and then get the corresponding z values from the topo contour lines. I think it can be done by interpolating between the z values for the two apparent intersection points of the 2D line and the contour lines, the x and y values will be the same for the points that falls between these two aparent intersections. Is there any lisp out there that can do that.
View 7 Replies
View Related
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
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
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
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
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
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
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
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
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
Feb 2, 2012
I need to place a circle, of a user-defined radius, as a marker at the endpoints of all lines in a drawing. how to accomplish this using lisp? It doesn't matter if they overlap; I can use OVERKILL to delete those objects.
I started the code with:
(defun c:cmark ()
(setq crad (getdist "
Specify radius: "))
)
But don't know how to cycle through the objects, determine the end points of lines only.
View 6 Replies
View Related
Dec 19, 2011
What I have is a topo plan in 3D (All contour lines have x, y and z values). My pipeline is on x and y coordinate only. I need to get the corresponding z value for say about 2000 points on the pipeline.
View 9 Replies
View Related
Nov 6, 2013
I need very very often to know the angle between two surfaces to write cnc programms...At the moment i draw allways two lines normal to the line between the two surfaces an use then the angle measuring tool.Works good, faster then bks and dimensioning, but need also time and always need to delete the lines after...
Is it possible to get a lisp which ask für 1 point on the first surface, 1 point on the other surface and two points on the line between the 2 surfaces? So the lisp know 3 points of each surface and can give out the angle between... Should be allways between 0-180°
So it needs only 4 klicks to get a angle! That would be so great! Is there a lisp programmer who can make this possible?
View 9 Replies
View Related
Aug 19, 2013
how to use AutoLISP to draw lines between two points. I have x,y,z coordinates for the end points in an excel sheet which I can save as a text file. I need to pull the coordinates from the file and use them to draw the lines. There are 2000+ lines so it is not feasible to draw them manually.
View 8 Replies
View Related
Nov 1, 2011
Looking to make a selection set of points that are on a specific layer, and then create a dimension between, in this case, two points. I feel like it should be very simple, but I can't get it to work for the life of me. Here is the test code I've been playing around with:
(defun c:test (/ sel1 TC)
(setq sel1 (ssget "X" '((8 . "VPOINTS"))))
(setq TC (polar (entget (assoc 10 (ssname sel1 0))) (dtr 180.0) 9))
(command "DIMLINEAR" (entget (assoc 10 (ssname sel1 0))) (entget (assoc 10 (ssname sel1 1))) "V" (polar TC (dtr 180.0) 9) "")
[code].......
View 1 Replies
View Related
Jul 7, 2013
I have plines of circuits that sometimes have T's (line goes along, then T's out then back to T point and then continues).
Here is example line -
(setq List_Pline (list (list 0 0) (list 1 1) (list 0.5 1.5) (list 1 1) (list 2 2) (list 3 3) (list 3.5 2.5) (list 3 3) (list 4 4)))
nth 0 = (0 0)
nth 1 = (1 1) - T point
nth 2 = (0.5 1.5)
nth 3 = (1 1) - T return point
nth 4 = (2 2)
nth 5 = (3 3) - T point
nth 6 = (3.5 2.5)
nth 7 = (3 3) - T return point
nth 8 = (4 4)
I need to be able to pick 2 points along the line and find the shortest route.
Examples -
1st point at 1,1 and 2nd point at 3,3 - new line is nth's 3,4,5
1st point at 0,0 and 2nd point at 1,1 - new line is nth's 0,1
1st point at 2,2 and 2nd point at 3,3 - new line is nth's 4,5
1st point at 3,3 and 2nd point at 4,4 - new line is nth's 7,8
1st point at 0,0 and 2nd point at 3,3 - new line is nth's 0,1,2,3,4,5
1st point is 1,1 and 2nd point is 1,1 - new line is nth's 1,2,3
I've tried using vlax-curve-getParamAtPoint, but it returns 1st T point.
Synopsis of program -
Select Pline
Pick 1st point
check if on line
Pick 2nd point
check if on line
check if 2nd point is before 1st point, if so swap locations
find last nth of 1st point
find 1st nth of 2nd point
return list
View 6 Replies
View Related
Aug 23, 2013
I am trying to get the end points of an invisible line it would be the line that you offset I know all about polar I just don't know which angle to add or subtract and I will pick the point on the side I want it to be on I am going to pick 2 lines and I want them to offset invisible lines in the middle the lines are not parallel.
View 8 Replies
View Related
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
Jan 9, 2014
I have double line pipe drawings but i have to change distances between of this lines in entire drawing and i was thinking that maybe there is a lisp code which can create new double line according to my specify dimensions ...
example :
Distance between lines : 100 mm
------------------------
------------------------
here is what i want to do :
1. select double line
2. specify new distance ( for example 200 mm)
3. lisp will create center line middle of the selected lines ( maybe it can ask me that this center line will be permanently or not )
4. lisp will create new double line from this centerline according to my specific distance
5. new double line layers will be the same with selected old double line
and this lisp has to work for double arc or quarter circles too.
View 7 Replies
View Related
Aug 20, 2012
We have a need to select a tangent line/polyline etc and then select two other points we would then like to have the program draw an arc through the two points and yet still be tangent to the initial line/polyline that we picked. We don't care what the radius is as we believe there is only one solution anyway. It would be wonderful if we could just use the Arc command and select start>Second Point> then just use the Tangent Osnap but I guess that is out of the question :-)
The only code that I have come across that even resembles this only allows for one point not two (STILL VERY HANDY AND VERY SLICK)
(vl-load-com)
(defun near_vertex_arr (obj / dxf_obj e_next obj_vlax pt_sel par pt_first pt_snd i bulge)
;bruno.valsecchi
[Code]....
How does everyone else hande this? By they way... I dont care what language it is written in :-)
View 7 Replies
View Related
Aug 8, 2013
I know how to increment pick points numerically (see below). How is it done alphabetically?
(defun C:test (/ pt# pt) (setq pt# (getint "
Enter number: ")) (while (setq pt (getpoint "
Specify point: " ))(if (/= pt nil) (progn (command "TEXT" "M" pt "" "" pt#) (setq pt# (1+ pt#)) ) ) ) (princ))
View 3 Replies
View Related
Mar 12, 2013
I am using autocad 2013 and importing PDFs into the drawing and recently the OSnap points within the pdf are missing. The PDFs are of floorplans and I was able to measure from wall to wall using endpoints and midpoints. Now I am only able to select the endpoints on the frame of the pdf.
Is there a switch that might have been turned off?
View 2 Replies
View Related