AutoCAD Visual LISP / AutoLISP :: Extracting HKCU Path From Unknown Version Workstation?
Jan 6, 2012
I have the following path declared for a R2007 workstation:
(setq rr (strcat "HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R17.0\ACAD-5001:409\Profiles\" (getvar 'CPROFILE)))
How can I extract this path without manually declaring it?
Something like:
(VL-Get-Registry-Path-Prefix (getvar 'CPROFILE))
Which will result in the following statement:
(setq rr (strcat (VL-Get-Registry-Path-Prefix (getvar 'CPROFILE)) (getvar 'CPROFILE)))
Dyslexia is a permanent physical disability that cannot be seen.
View 2 Replies
ADVERTISEMENT
Jun 12, 2013
We have a custom LISP program (Written, upadated in 2003) that takes a keyed in item number, opens and searches a .txt file with four coulmns, for the keyed in item number (column 1) and returns a part number (column 2), description (column 3) and any information in column 4.
Here is the Part of the cod in question:
(setq recx (open "H:/ACAD2012/alcocustm/LISP/hardware.txt" "r"))
(setq d "?")
(setq rec (read-line recx))
[Code]....
A quetsion was asked if the data in the .txt file could be put in an Excel file. I tried looking at other post, but I can't seem to find a clear cut way to open and extract the data. Or this old dog overlooked a boand. Is there a easy way to do this, similar to the above?
View 8 Replies
View Related
Sep 13, 2013
I'm running AutoCAD 2012 (base version, but part of Mechanical install). Part of my .mnl file is set to run (command "cube" "off"). On one machine (Windows 7), it works fine. I'm temporarily on my laptop (Windows 8), & that portion no longer works.
If I type cube in the command line, it works fine. However, if I type (command "cube"), it says unknown command "CUBE".
View 5 Replies
View Related
May 27, 2013
How can specific attribute values be extracted from a drawing and assigned to a variable in lisp.
The existing title block is having attributes : Area, Sub area, Description, Drawing type. I want to extract this values and assign it to some variable which I have already listed and then it shall be assigned to some other attributes in the same drawing with Area1, Subarea1, Description1, Drawing type1... and so on.. Both the attributes shall be in the same drawing file.
View 3 Replies
View Related
May 11, 2013
how to extract the attribute value of a particular block in multiple drawings to an excel file.
Eg... there are nearly 800 drawings where I need to list down the description and Drawing number which is mentioned in the title block name "Title". The Drawing Number and the description is done in same attribute block. extract the data into an excel file or txt file. All the drawings are saved in one location.
View 7 Replies
View Related
May 23, 2013
Back in the day, there was an application that showed the drawing version # in the icon in windows explorer. That was good for then, because of the lack of object data in many of the vertices. The link I have isn't valid anymore and it didn't work in Win7.
What I'd like to have is something that will show the different Acad versions related to the icon using the product ID, for example:
ACAD-5xxx = 2007
ACAD-6xxx = 2008
ACAD-7xxx = 2009
ACAD-8xxx = 2010
ACAD-9xxx = 2011
then in 2012 they changed to Axxx
2013 = Bxxx (???) I dont' have 2013 loaded
2014 = Dxxx (what happened to Cxxx?)
With the lack of backward compatibility between versions for objects (and I totally get that), it would be nice to be able to tell by an icon which version was used to create the drawing. I know the version information is stored in the header, which can be read, I'm just not a programmer.
View 3 Replies
View Related
Jul 30, 2013
I'm trying to get the file name of a file outside the search path. Obviously (findfile) is not an option. The file location changes with each project so adding a search path is also not an option. I can get the path to the file but i can't seem to figure out how to get the file name. I can also get the first set of characters, as they are constant from project to project, it's just the end of the file name that changes. The file is always a PDF.
View 9 Replies
View Related
Feb 12, 2013
I'm try to write a list to produce a script file!I just want to insert a dwg file in current drawing.back to MS Windows, in case of having [space] in a folder's name, we should use "" marks:
CD "Program Files"; DEL "file 10.txt"; ....
I tried both with and without "" marks but I failed!I pasted part of my code below with result of each case:
(setq TBFile "H:z.autocadA1 A2 A3.dwg")
(write-line "-INSERT" des)
(write-line (strcat "*" TBFile) des); ; *H:z.autocadA1 A2 A3.dwg <<=should be this
(write-line "0,0" des);;insert point
(write-line "1" des);;xyz scale
(write-line "0" des);;rotation
[code]....
View 4 Replies
View Related
Dec 17, 2013
I'm using a Lisp which searches a certain folder and then updates all blocks, which are nested in that folder.
My issue is, that I'd like to use more than one folder on different path, where the LISP can search for this files. Is there a way to use multiple search path?
The code I'm using now to search for the blocks is: (setq dir "I:\AutoCAD Blöcke\Template\Support")
View 9 Replies
View Related
Jun 4, 2012
I am using Autocad 2013, and need to have lisp wblock to a 2010 format file. Is there a way I can force it to, without the trouble of opening the file dialog box and setting the format there?
View 4 Replies
View Related
Jul 4, 2012
like in AutoCAD there is REMEMBERFOLDERS can u tell me if i use syntax with getfiled and i want the path to be remember next time what should i do or what syntax i use for that.
View 1 Replies
View Related
Sep 18, 2013
Some of our 64-bit users lose their custom Support File Search Paths.
After reading about it, I saw that I could add them back in by putting
(setenv "ACAD" "S:\Fonts;S:\Acad2007\Hatch_Patterns;S:\Acad2007\Lisp;S:\Acad2007\Simpson\Menu;”)
at the end of acad2013.lsp.
1. However, I get malformed string on input error in AutoCAD.
2. My other question is do I need to list only the custom paths or all of the built-in paths as well?
View 1 Replies
View Related
Dec 10, 2013
Could a .lsp file work with the block editor so that double-clicking a block will make it skip straight to the editor without displaying the "Edit Block Reference" dialoge?
View 1 Replies
View Related
Aug 2, 2013
Have issues with creating an AutoCAD deployment and "The path of the added item is too long" error message?
I understand that the paths are limited to 255 characters but I tried just a local path and I get the same error.
Under Additional Files in deployment options, I want to add 2 folders under <Installation Directory> and add 2 files under Support folder.
1st folder would be ARG folder for a custom profile xxx.arg file
2nd folder would be Template with a custom template xxx.dwt file
Under Support, I want to browse and add two files: custom accaddoc.lsp and enterprise acad.cuix file.
All of those files reside on a share drive but the paths are about 40 char so I'm way below the limit.
Every time I want to add a folder under <Installation Directory> I receive the error message:
The path of the added item is too long: "Create New Folder" Please limit this path to -28 characters (currently 17).
So I copied all thos files locally but the same error show up. Is this a bug? I can't customize my deployment if those files are not available.
View 2 Replies
View Related
Oct 12, 2011
I have set up a master set of dwg. files we use to create our construction documents. The files consist of a master file that xrefs base files. All of our files are named using the project # first. (i.e. 2011001c.dwg). I have set up the master set using x's to replace the numbers.
Here is how it works:
XXXXXXXc.dwg (master file) relative path xref's the following files.
XXXXXXXlw.dwg
XXXXXXXvlw.dwg
XXXXXXXeg
XXXXXXXfg
XXXXXXXtitleblock
note: all of these files are saved in the same folder.
I am trying to find a way to keep the xref paths working when I copy the files to a project folder and rename the files using the actual job # insead of the x's as place holders. As it is now, when I change the drawing name the reference is lost and I have to manually change all of the xref paths in the xref manager. Is there a command, program, or lisp routine than can change the file names and update the paths automatically.
View 1 Replies
View Related
Sep 10, 2012
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....
View 6 Replies
View Related
Aug 22, 2012
Our I.T department uses kixstart to run a batch script every morning, which is supposed to establish a network connection. The connection is 9/10 times available. 1/10 times it fails and means that workspaces and other user defined settings are inaccessible.
Bringing up the issue with I.T seams to eparch on there skills as a professional so nowadays I tend to bring it up once maybe twice but then settle for ding it my self
So what I found out is the following batch scrip/ snippet is used to establish a network
net use P: \AutoCAD_2012-08-22
I could compile a batch and then launch it using a lisp for example
(command “startapp”….
Or
(command “shell".However this would be hakky and also requires two files (the lisp and then also the bat file, rather keep it simple just the one).Is it possible to establish this connection using lisp?
View 2 Replies
View Related
May 27, 2013
I am trying to make a script for inserting a standard title block in some drawings. ( which needs to be often done for different projects). The title block is kept in the network path. How can i specify the path in the script file in order to insert the block.
-Insert,> Block name > (I need to specify the drawing in the network to get the block in it)
View 3 Replies
View Related
Jan 3, 2014
I do a lot of repetitive tasks in my daily drawings and I’d like to make life easier! I was researching how I could write a lisp to draw a walkway path for a roof. I came across a couple of interesting posts but couldn’t follow the code because of my lack of understanding the language.
So what I do is draw a 30” x 30” square (using the rectangle command). Then copy it so there is a 2” gap between them. Then I go back and hatch them with a dot hatch scaled to 96. What I’d like to do is type a command and it would draw the walkways for me and hatch them if possible. The problem is the last one is a custom cut size depending on the length of the walkway run?
Now I know I can draw a line, draw the square, hatch the square, array it on the path with set distance between items, then fix the last one so it looks the way I want it to, and then delete the line. But why do all that when I have a program that allows me to customize it to be done for me?
View 6 Replies
View Related
Jul 22, 2013
I used this snip it to add the path for network tool palettes. It works but it keeps adding the same search path every time i open a new session of AutoCAD. The list keeps getting longer with the same information. Say you want to make sure your users all have a certain tool palette.
(setq tooldir "z:\1111\2222\test]" toolpaths (vlax-get-property (vlax-get-property (vlax-get-property (vlax-get-acad-object) 'Preferences) 'Files) 'ToolPalettePath))(if (not (vl-string-search tooldir toolpaths)) (vlax-put-property (vlax-get-property (vlax-get-property (vlax-get-acad-object) 'Preferences) 'Files) 'ToolPalettePath (strcat (vl-string-right-trim ";" toolpaths) ";" tooldir) ))(setq tooldir nil toolpaths nil)
View 3 Replies
View Related
Dec 20, 2012
I have a file path im trying to capture in a text file however its not working and autocad is prompting back,
; error bad argument type: streamp nil
Im assuming its because of the slashbacks but Im not sure..
Hence the code so far...
(defun C:GO ()(SETQ ACADLSP (findfile "acad.lsp"))(setq f (open "C: est.txt" "w"))(write-line ACADLSP f)(close f))
View 4 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