I know it doesn't work because if I change the T to nil as demonstrated bellow I should invoke the opposite reaction from autocad but instead I get the exact same outcome which is an alert telling me the file exists?
Modify the attached lisp I found in this forum to work using a different hatch pattern, scale and angle. The new hatch should be in default Autocad "LINE" pattern and angle set to 90 degrees (vertical). If possible, I would like the angle and scale to be editable. Find attached Multi_Hatch-45 code posted by CADaStroumph in 2008.
This lsp was passed on to me from a colleague but he doesn't know where he got it. It does a useful procedure of placing each xref, residing in the drawing, to a unique layer. The layer name is derived from the xref name. I would like to edit this to take only part of the xref name. This system I work with requires all files to have the job number as a prefix eg LE1399901_Contours.dwg, so the xref name would be LE1299901_Contours by default. I want to remove the first 10 characters to be left with "X_Xref-Contours" layer name using this code.
(defun dxf (i a) (cdr (assoc i a))) (defun c:lxr ( / ss cnt xrs en ed bn xp xbn ) (setq ss (ssget "x" '((0 . "INSERT")))) (setq cnt 0) [code]........
LISP code to link to a scr.file.I would like to run ACADDOC.lsp with abobe code everytime I open a drawing.But I want to link the KISP file to script file of mine like C:
The above gets me the grid lines; but I have a block inserted at both ends of the grid line; how do I get the selection of those entities (selection set "frame") after each array?
or I would need to map a point list and draw each grid individually how do I go about that?
Attached is the sample of the output I'd like to achieve using LISP.
The code removes prefixes bind ($ 0 $), renaming layers, blocks, dimension styles, but some objects do not change the name as linetypes, text styles and duplicate names.If I have an existing name, I want to change the name with a (2) at the end.Example.
Layer: FloorLevel$0$Door90 If the layer "Door90" is existing, is renamed to "Door90 (2)" (defun c:delprefixe(/ ActDoc Name NewName)(vl-load-com)(defun RemoveBindPrefix (String / Pos LastPos)(if (setq Pos (vl-string-search "$" String))(progn(setq LastPos Pos)(while (setq Pos (vl-string-search "$" String (1+ Pos)))(setq LastPos Pos))(substr String (+ 2 LastPos)))String)); [code]....
I have lisp code, which count total length, but I need that it count and multiply by constant which I choose manual (such as in example, total lines yellow length * y + total blue lines * x = ... , example 50*2 + 60 * 3=280),
remember the another code, such as I have d200 with total l=1000 and d250 with total l=1500, i need to count total cost such as 1000*y+1500*x
one think, diameters numbers is not only 1 or 2, it can be many different diameters.
hiding the modellayout from code.My code is updating the registery properly.but it is not reflecting/hiding the model/layout tabs in application. hide/trunoff from code.Model/layout is not required for my application.Is there any command to hide model/layout tab.
void CMyApp::TurnoffModelViewLayoutTAB() { //TurnOff Model View Tab
I have the following code in a toolbar button that when I click on a setup within this tool it imports that setup into my current dwg. How to edit this code so that it will continue to import the setup of choice into the new drawing..but in addition....set the new one current & delete all previous setups that were in the drawing?
Is there a way to determine the type of ACAD object that the user selected? I need to retrieve the value from either a dimension or text. The info could be in either format so the lisp routine needs to determine what was selected so the correct vla-get command is used.
Once I determine what the object is I can use an if statement to retrieve the value.
;user selects the object (setq dimobj (vlax-ename->vla-object(car(entsel)))) ;If ACAD object is a dimension do this. (setq dimvalue (vla-get-textoverride dimobj)) ;If ACAD object is text do this. (setq dimvalue (vla-get-textstring dimobj))
The attached image shows a table that I created as a AEC Object from my Civil 3D Alignment (i can turn it to 'MText' and then 'Text' in one or two steps). What I need is a routine, or anything, that fills the third column with an information based on the second column: the deflection angle, something like that:
Curve Angle Type of angle
C1 22°30'00'' 2
C2 39°21'28'' 3
C3 44°59'59'' 3
C4 45°00'00'' 4
C5 45°00'01'' 5
Is there something I could read to study to solve it myself and specify my own angles/types of angles?
How can I iterate through and check the object type of all objects in model space? And... then delete them if they are certain types... like lines, circles, polylines, text, mtext, etc?
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.
We have a lisp routine that I co-authored ages ago and then haven't done much programming in about 7 years. I seem to have forgotten much of my language skills. This portion of the lisp routine was running fine in autocad 2005 which is what the computer had on it, and it doesn't run on autocad 2010.
I've narrowed it down to the while statement which is why you see it commented out, but that portion is necessary. My main question is was there a change in the language specifically the while statement between 2005 and 2010?
So i have almost 30 installs and my custom programs are working in all but this new install. Now when i pick on the tool palette that runs the program, i get a message shown in the attached png, then when i pick "OK" i get "Unable to load dialog box."
I've searched these hallowed halls but all the messages seem to point to 2002 versions of ACAD Map and i'm running plain AutoACAD (that came with Product Design Suite, aka Inventor.)
I upgrading all our lisp routines to 2013. I have a routing that modifies a block attribute. Then ENTMOD returns with the proper information. ENTUPD reurns the same enity name. The block never changes. The same routine woks in 2010.
I have made a block with consist of shape drawing and some attribute data that must specified when the block inserted. my question is, how to make "warning error input" appear if mistake input occurs?
I know how to retrieve the entity information from the block, but can't figure out how to write the loop statement to loop, look for first attribute, assign to a variable, goto next attribute, assign to different variable, etc., etc...
In my research, most programs I've seen it execute the loop, assign to a variable, then print/put that data somewhere, loop again and utilize the same variable to print/put the next data somewhere.
I would like each attribute within a block to be assigned a separate variable.
The good news is that, if I were righting a routine that locks up AutoCAD, I'm finished. The bad news is that I'm not.
The code below is the portion of a routine where I have the user select 2 points and then pass those points to the Zoom command and the M2P osnap. The problem is that, when the Mid Between 2 Points osnap tries to use the first point, it returnns an "Invalid point" message, enters a loop and locks ACAD.
(defun C:ZC () (setq PointOne (getpoint "First point of M2P ")) (setq PointTwo (getpoint "Second point of M2P "))
Should SETENV/GETENV be writing/reading to and from the System Registry?
After installing ACAD 2013 as a trail this now seems to be the behaviour, only found it when GETENV calls started to fail. This has also affected previous versions installed on the same workstations.
In my acaddoc.lsp I have it load an autoload.lsp file that contains many lisp routines (attached). I am getting the "extra right paren on input" error. It appears to error after the third line in the autoload file "san18"....I removed everything after the third line and no error, I put them back and it errors and only loads first three?
I am using Civil 3D 2014 and I have added all neccesary paths to the trusted locations.