Is there a way to find the name of the second folder?
Is there a way to find the name of the third folder?
The string length of the characters for each of the first, second, third (and so on) folders are different, which means I can't count character using the "substr" function.
I recently wrote a lisp routine that was supposed to get the 4 coordinates of a rectangle (LWPolyline). It worked fine in *MY* tests. But when someone else ran it, the routine operated as though the order of the points had been rearranged.
How can I get the points AND the order in which they belong?
Here's a sketch to show you what I mean. As part of my troubleshooting, I had a lisp routine draw a new pline using the points gathered by my first routine. The result of that on the left. On the right is the result of that when someone else runs the two routines.
I need to return the entity name of the largest (longest closed) polyline in a selection set. At this point I have no trouble creating the selection set and even getting the area of the boundingbox, which is not the most accurate way to find the true size, but it's a start. The part that has me stumped is: if I iterate through the selection set, then how can I compare one to the other when I have access to the current entity. I've been staring at examples of lambdas but it seems to me that iterating through the selection set is going about it wrong in the first place.
Below is my current code with a remaining issue. I can return the largest area of the polylines (no good for more than two entities in selection set), but I do not know how to return the entity name:
(IF (> (SETQ SS (SSGET "x" '((0 . "*POLYLINE") (8 . "POOL") (-4 . "<OR") (62 . 5) (62 . 256) (-4 . "OR>")))) 1 ) (PROGN (SETQ a (1- a) ent (CDR (CAR (SSNAME ss a))) en2 (CDR (CAR (SSNAME ss (1- a)))) ar1 (APPLY '* (LIST (LAMBDA (ent) (VLAX-INVOKE-METHOD (VLAX-ENAME->VLA-OBJECT ent) 'getboundingbox 'minpt 'maxpt) (SETQ pt1 [code]......
(layoutlist) ... returns a list of strings of the layout tabs in the drawing.I've used this ages... Isn't it a core lisp function, or is it coming from express tools or somewhere else?
I've got a subroutine that gets the centroid of a closed polygon (lwpoly). It appears to fail if the polygon has any zero length line segments. I've added a trap that catches the error and "highlights" the offending polygon, but it stops there and does not return to the main function that called the subroutine. Is there a way to get back to the main function from the trap?
Here's the subroutine (original function by _gile (Autodesk LISP Forum 9-18-2006):
(defun return-centroid (lwpoly space / obj Region Centroid) (setq *error* trap1) (setq obj (vlax-ename->vla-object lwpoly)) (setq Region (vlax-invoke space 'addRegion (list obj))) (setq Centroid (trans (vlax-get (car Region) 'Centroid) 1 0)) (vla-delete (car Region))
I work with ANGTOS and ANGTOF quite a bit. I'm working with latitude and longitude conversions in MAP 3D for an application where accuracy is top priority. Most of the time ANGTOS (and RTOS, for that matter) return an accurate result for the number if decimal places requested, but then I run into a situation like this:
I have to update a block in literally thousands of cad files. I have the book "AutoCAD Secrets Every User Should Know About" and the author gives examples of this by using a Batch File, Script File, and then Lisp Routine. Any easier way to do the following:
Insert "Gennnotes=" (updating the block) into any drawing that has this block in the drawing already, if not Quit.
Typically to do this I would open the drawing "insert" "gennotes=", then cancel the command and save the drawing. I have a lot of subfolders that also hold drawings so the command would have to search through each subfolder for dwgs.
Like I mentioned above, I tried to use the Batch File/Script Method but my batch file failed. It could find the folder Autocad 2012 - English. For some reason it was not seeing the spaces in between. Not sure. Here's the batch file portion of the routine:
Batch file:
For /r C:Sybex %%f in (c:sybex*.dwg) do start /wait C:ACAD2012Autocad 2012 - Englishacad.exe "%%f" /b C:gennotesupdate.scr
Is there a lisp that will allow me to do a continuous dimension, but will alternate the dimension position from low, high, low and high? If there is no lisp already created, how to create one?
See Continuous dimension attachment for example.
I work at a glass and glazing company and this is how we dimension mullion width and DLO. See typical window dimensioning attachment for window elevation with dimensions.
I have a list ("temp.dwg" "temp2.dwg") and would like to add the string "insert text here" into each item in the list resulting in ("insert text heretemp.dwg" "insert textheretemp2.dwg"). how would i go about doing that using LISP?
Is there a way to programatically set a visual style before a drawing actually opens?
We have some huge models and people seem to forget to change their visual styles back to 2D wireframe before saving and exiting drawings. Some models will crash on some workstations when trying to open in a rendered mode.
I found a lisp with a function that looked to set viewport visual styles. But it does not seem to be supported anymore. --> (vla-put-VisualStyle vport 1)
I'm trying to write a lisp routine that, when I invoke the mleader command, osmode is set to "nearest" & orthomode is set off. I then would like the original settings to be returned.
Lisp that switches back on Selection Preview i.e. thickens and highlights lines when you hover over them?I don't know why, but they are always unticking the boxes.
Is it possible to execute a certain command based on multiple selections withinin a dcl? for example: two radio colums, one with selections A and B, and a second with selections 1 and 2. is it possible to program commands based on user selections from each column? ex: if A and 1- do a command. A 2- do a different command, etc...
I tried :
(action_tile "key1" "(setq A t") (action_tile "key2" "(setq B t")
I am trying to find a lisp that would get an attribute value (tag name = NBR_5) . I'm trying to run a simple routine that would let the user place the value from the titleblock attribute as text on a drawing. I see a ton of articles regarding getting attributes but I am not well versed in programming.
I'm trying to find acceptable point values to feed to the vlax-3d-point function for a vla-addmtext function. With vanilla lisp I just provide the point as x y = "7/32" "2-3/8". So I assumed that I could drop a 0 in for the z like: (VLAX-3D-POINT "7/32" "2-3/8" 0).
Then I thought I was going to be tricksy and try (vlax-3D-point (getpoint)) believing that I could pick the point and get what I need to feed the function, but yet again, no deal. The command line gave me:
node of #<variant 8197 ...>
Nothing I can use in my code. So how do I find the point in a format that vlax-3d-point will like?
I use Spell Check regularly and I always check the entire drawing. I would like to add to the Spell macro so that when I pick Spell from the toolbar it goes past the Check Spelling window and begins checking the entire drawing.
I believe I need to insert Alt S into my macro to select Start from the window to begin the check. Is there a character or series of characters that will represent Alt in a macro?
I upgraded from Autocad 2004 to 2012 recently and my lisp file doesnt work anymore.
what it's supposed to do is when looking at the layout tab that you want you can switch to the model space location of the same zoom as the layout tab without messing with the layout zoom.
I need a program that simulate this DOS command: dir /on/b *.dwg >list.txt
it list all dwg files on current open dwg file folder and sort them and finally put them in a text file with list.txt name. something like thistype list.txt)
(sort alphabetically and logically) because of disabled DOS utility in my PC I need a pure lisp functions, I tried to wrote this program but I couldn't!!
Instead of starting an application, how to shut all of its instances down. Let’s say I have iTunes and/or Internet Explorer w/ a few tabs open and I can close them down without getting to the application to terminate it the usual way.
I am trying to get my original layer and lintype reinstated after the user is finished with the pline..I know Im suppose to use the while command but am now completely lost on which way to do this
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.