What i need to happen is this: When "whatever" returns "value0" i need to set "value0" to the first item in list "newlist". Then when "whatever" returns "value1" i need to set "value1" to the second item. Now I can do it the long hand way, but i am trying to simplify this step, and shorten up my overall program.
Any LISP routine or another trick to increase an attribute alphabetically?
I have a block whose tag is defaulted to "A". Typically, I will copy this block however many times I need it in a drawing (could be 20 or so). I would like to increase the letter by one, either when I copy it or afterwards when they are all placed.
I'm wondering if there is a lisp possible to measure area's by pick point (as in bpoly). This little feature exists in Microstation so i was looking for something similar.
Is it also possible if this lisp can measure areas from an external reference (dwg, dxf, dgn, shp etc..)? I'm kind of new to AutoCAD in that sence.
I used to have a lisp routine that would allow me to pick one dynamic block and it would select all instances including the blocks that have become anonymous.
I like that Autodesk now allows us to just pick a command's option from the command line instead of typing a letter in the option. For example, when drawing a rectangle we're prompted to "Specify first corner point or [Chamfer Elecation Fillet Thickness Width]" and if we wanted to draw fillets on the rectangle we can simply PICK that option from the prompt in the command line OR enter an "F" and return.
Is there a way we can use this functionality in our custom programs?
Normally when applying the matchprop command in CAD, one has to first pick the template element, and then select the elements which should have this template element's properties copied to/matched.
is it possible (via lisp perhaps?) to reverse this order, so that i can select a bunch of elements (e.g. through the quickselect icon) and THEN apply a matchpropertieslisp command, then select a single template element which the initially selected elements should mimic?
I am looking for some code that would allow me to select a MTEXT Entity - or other entity - (as the DEFAULT option) but also to allow me to type in some text manually or to pick a point in the drawing. Something that would present the user with:
"Select an object or [P to pick a point]" or
"Select MTEXT or [M to type].
I can write some code to type in text manually as the default option and get the second option to select entity using get string and then write some condition of if code but I don't know how to do it having entsel as default option.
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.
I am in need of a lisp routine which will automatically pick up all hatch and solid hatch patterns within a drawing and change the colour to colour 254.
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.
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.
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?
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.
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:
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.
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 :-)
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?
My first lisp, so bring it hard on me I want to be an expert in autolisp .
My lisp is meant to do the following:
draw a rectangle with ”0” fillet. It can be done either via rectangle command, or pline command. The attached lisp has the variant with the pline-case.
The, I need to draw inside a smaller rectangle, with a fillet value, that is promoted and indicated by the user. The smaller rectangle must be centered inside the bigger one. I thought it was a good idea, to take one insertion-point for the bigger rectangle.
and to calculate a 2-nd insertion-point for the smaller rectangle, via "polar" function.
What I get:
the 2-nd insertion point is put the same as the 1-st one.
I wish to draw the bigger rectangle with one layer "example: Layer 1", and the smaller rectangle with another layer "example: Layer 2".
I am working on a little lisp routine to draw splines, but can't get it working. The basic idea is that i first select a set of points that i can feed to my spline command.
There are times that I have a really long curb polyline that has both line and arc segments. I wish to pick two points along that polyline and have it give me the distance between those two points along the path of the polyline.
Do we have this ability natively? Have I been missing something all this time? Normally I have to make a copy of the original entity, ... break, break, list erase or undo....
I want tp write my first programm with autolisp. I use Autocad 2012(rus). When I run my script I see that some of points are missed in the autocad. Maybe I do something wrong?
(setq RB 300)(setq RM 70)(setq N 12)(setq M 11)(setq I 0)(setq J 0)(defun alphai (i) (/ (* (/ (* 360 i) N) PI) 180))(defun gammaj (j) (/ (* (/ (* 360 j) M) PI) 180))(defun XIJ (I J) (* (+ (* RM (cos (alphai I))) RB) (cos (gammaj J))))(defun YIJ (I J) (* (+ (* RM (cos (alphai I))) RB) (sin (gammaj J))))(defun zij (I J) (* RM (sin (alphai I))))(setq I 0)(setq J 0)(setq PT0 (list 0 0 0))(setvar "CMDECHO" 0)(repeatM (repeat N (setq PT (list (XIJ I J) (YIJ I J) (ZIJ I J))) (command "_point" PT) (setq I (+ I 1)) (setq PT0 PT) ) (setq I 0) (setq J (+ J 1)))
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?