AutoCAD Visual LISP / AutoLISP :: Reinserting A Standard Base Template For Layering?
Oct 28, 2012
creating a lisp or pulldown with some standard features in it.
what i would like to do is be able to quickly insert a template (layers/linetypes/colours etc) which is the same used in our initial drawing. I'm a big fan of constantly purging and auditing my drawings to keep them clean and in a previous workplace we had the ability to reinsert all the default layering.
View 2 Replies
ADVERTISEMENT
Dec 27, 2013
I've created a couple of programs:
One - that will start a new project file, add our standard drawing sheets
two - Insert a bunch of wblocked components based on user input
programs 3 - 6 all do the same as program 2, just different components for different sheets.
I can run all these programs and they work (i need to do a lot of "clean-up" but they work)...
I have them set-up to open the next drawing.But i have to type in the next command, and continue until all my programs and done running.
My questions is how can I accomplish this without having to continually type in commands?I can't run these as a script, but is there another method?
View 8 Replies
View Related
Sep 4, 2012
I have a small number of drawings that I use very often. I would like to make a menu item to open a certain drawing but I keep getting stuck when the drawing name should be entered automatically.I use the code
^C^Cfiledia;0;open;"test.dwg";filedia;1;
The drawing is my support file search path and the name is unique. How do I get this to work properly?When running this command:
Command: filedia
Enter new value for FILEDIA <1>: 0
Command: open
Enter name of drawing to open <C:previous.dwg>:
*cancel*
Command: "test.dwg"
Unknown command ""TEST.DWG"". Press F1 for help.
Command: filedia
Enter new value for FILEDIA <0>: 1
It asks what file to open and suggests the last opened file, and whatever I tried so far this keeps happening.
*.scr files are not allowed on our network, I can't create or rename files to *.scr. Of course I could ask the admins to allow this but I think our security policy is more important than me having a button to open a file.
View 6 Replies
View Related
Feb 20, 2013
Is there a way to identify the files with a non-standard layer convention? Once identified and located,I plan to clean up manually
The folder I'm working with contains thousands of DWGs and I've discovered some layer names which differ from our standard naming conventions.
View 5 Replies
View Related
Nov 12, 2013
How do I tranfer all my standard autocad variable settings into a new version of Architecture? I have my dimensioning settings, etc set a certain way in my standard autocad and now I want to start using Architecture but need all my old settings.
View 9 Replies
View Related
Aug 23, 2011
how to make a toolbar button so that when i click it and select a few single text, it will automatically change the text base point to be at "MIDDLE CENTER"....
At the moment, i use to create a button with macro of " ^C^C_text;j;mc "....But the problem is whenever i use this button, i still need to type "MC" at the command prompt.. How to make it so that after i click the button, all i need to to is just select the text..
View 9 Replies
View Related
Jul 3, 2012
" Convertion of AUTOLISP base routines to Diesel MACRO based routine to be used in a AUTOCAD LT based platform "
Here i am attaching the lisp file for ready reference.
View 1 Replies
View Related
Feb 11, 2013
Is there a way to identify non-standard layers and the files in which they're located?
The folder I'm working with contains thousands of DWGs and I've discovered some layer names which differ from our standard naming conventions.
I need to clean up these anomalies so am seeking a way of identifying/locating them.
View 2 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
Jan 17, 2013
Is it possible to make an attribute or a field in a template with page numbering for layouts? Is it possible to make an attribute or a field in a template with the name of the layout?
View 7 Replies
View Related
May 2, 2013
I am trying to entmake a hatch entity from a hatch template.
After entget the template hatch entity, i get the followings
Select object: ((-1 . <Entity name: 7ed11b78>) (0 . "HATCH") (330 . <Entity
name: 7efc7c10>) (5 . "737") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 .
"SECTION-LABEL") (62 . 255) (100 . "AcDbHatch") (10 0.0 0.0 0.0) (210 0.0 0.0
1.0) (2 . "SOLID") (70 . 1) (71 . 0) (91 . 1) (92 . 1) (93 . 8) (72 . 1) (10
633596.0 5.79713e+006 0.0) (11 633519.0 5.79713e+006 0.0) (72 . 1) (10 633519.0
5.79713e+006 0.0) (11 633519.0 5.79708e+006 0.0) (72 . 1) (10 633519.0
5.79708e+006 0.0) (11 633500.0 5.79708e+006 0.0) (72 . 1) (10 633500.0
[code]....
Now I wrote the following code using the above data as follows
(entmake (list (cons 0 "HATCH") (cons 67 0) (cons 410 "Model") (cons 8 "SECTION-LABEL") (cons 62 255) (cons 10 (list 0.0 0.0 0.0)) (cons 210 (list 0.0 0.0 1.0)) (cons 2 "SOLID") (cons 70 1) (cons 71 0) (cons 91 1) (cons 92 1) (cons 93 8) (cons 72 1) (cons 10 pt1) (cons 11 pt2) (cons 72 1) (cons 10 pt2) (cons 11 pt3) (cons 72 1) (cons 10 pt3) (cons 11 pt4) (cons 72 1) (cons 10 pt4) (cons 11 pt5) (cons 72 1) (cons 10 pt5) (cons 11 pt6) (cons 72 1) (cons 10 pt6) (cons 11 pt7) (cons 72 1) (cons 10 pt7) (cons 11 pt8) (cons 72 1) (cons 10 pt8) (cons 11 pt1) (cons 97 0) (cons 75 0) (cons 76 1) (cons 98 1) (cons 10 (list 0.0 0.0 0.0)) (cons 450 0) (cons 451 0) (cons 460 0.0) (cons 461 0.0) (cons 452 1) (cons 462 1.0) (cons 453 2) (cons 463 0.0) (cons 63 5) (cons 421 255) (cons 463 1.0) (cons 63 7) (cons 470 "LINEAR")))
The point variables pt1, pt2....pt8 are all defined. But when I run the code the hatch is not being created? Why?
View 1 Replies
View Related
Oct 29, 2013
Is it possible to edit xrefs so that the xref layers correspond to your base model space layering? In other words, when you do an xref edit in your base drawing (not separate xref file) the layering will react to your edits using base plan layering? I use on screen layer tool bars and xref layers are on a separate layer and do not respond to these toolbar.
View 1 Replies
View Related
Jul 12, 2012
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.
View 6 Replies
View Related
Nov 14, 2013
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?
View 2 Replies
View Related
Oct 7, 2013
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)
View 9 Replies
View Related
Oct 11, 2012
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.
attached is what I have written so far:-
View 4 Replies
View Related
Jun 20, 2013
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.
View 4 Replies
View Related
Sep 7, 2012
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")
(action_tile "key3" "(setq 1 t)(done_dialog)")
(action_tile "key4" "(setq 2 t)(done_dialog)")
(if
(and (a) (1)
)
(command ...
but was unsuccessful. no matter which combination was selected, the command under all combinations would run.
View 2 Replies
View Related
Jun 3, 2013
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.
View 9 Replies
View Related
Jun 22, 2012
I have a routine that work fine, but I receive a nil at the end of command. How to fix that?
View 7 Replies
View Related
Oct 9, 2013
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?
View 9 Replies
View Related
Dec 19, 2011
What is the magic word for put a point at each end of an arc, the lisp I have only put a point at center of the arc.
(defun cAA ( / i j ss e1 e2 p1 p2 p3 points )
(if (setq i -1 ss (ssget '((0 . "ARC"))))
(progn
[Code].....
View 5 Replies
View Related
Dec 30, 2011
Is there a quick way of getting the value of an attribute?
I have an attributed block called "tp_attributes" and it has and attribute called "OrderNum".
I just want to be able to quickly grab that value.
View 3 Replies
View Related
May 29, 2013
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?
View 1 Replies
View Related
Nov 8, 2011
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.
(defun c:msp ()
(setq cm (getvar "cmdecho"))
(setvar "cmdecho" 0)
(command"view" "d" "tmp")
(setvar "tilemode" 0)
(command"pspace")
(princ "Click TWICE on desired VPORT: ")
(command "mspace" pause "view" "s" "tmp")(princ)
(setvar "tilemode" 1)
(command "view" "r" "tmp")
(setvar"cmdecho" cm)
(princ)
)
View 4 Replies
View Related
Oct 27, 2012
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)
test1.dwg
test2.dwg
test100.dwg
test256.dwg
test1005.dwg
(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!!
(defun c:listMaker()
(vl-load-com)
(setq path (getvar "dwgprefix"))
(setq fn "list.txt")
[code]...
and also I need a append a string(='This Is EOF') in the last line of the "list.txt" file.
View 8 Replies
View Related
May 10, 2012
I have text objects with the same Z value and I will select as follows:
(setq sstxt (ssget '((0 . "TEXT")(8 . "APS-text"))))
How to store this value in another variable "zvalue" to apply to:
(command "change" "select text objects" "" "_p" "_e" zvalue "") ?
View 9 Replies
View Related
Oct 17, 2011
the following returns true since the @ symbol tests for an alpha character.. (wcmatch "S101" "@*").What is the Dot Net equivalent?
View 2 Replies
View Related
Jul 10, 2012
Is there a command that is the opposite of starting an application to open up a file? Like:
(startapp "PlaySound.exe" (findfile "CuckooClock.wav"))
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.
Naturally,
(endapp "iTunes.exe") doesn’t work :-))
View 3 Replies
View Related
Apr 13, 2012
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
(DEFUN c:TEST1 ()(if (not (tblsearch "LTYPE" "MYWC")) (command "-linetype" "LOAD" "MYWC" "C:/COUNTER.LIN" ""));SECOND PROGRAM...;CREATE CORESPONDING LAYER...(command "._Layer" "Make" "WC LEIDING" "Ltype" "Continuous" "" "Color" "211" "" "")(SETQ MYOLDCELTYPE (GETVAR "CELTYPE"))(SETVAR "CELTYPE" "MYWC")(while (PROGN(COMMAND "pline")(SETVAR "CELTYPE" MYOLDCELTYPE)))
View 5 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