AutoCAD Visual LISP / AutoLISP :: How To List All Of Loaded Programs (LSP / FAS)
Jun 11, 2013
I want to list all of loaded lisp programs in AutoCAD (both .lsp and .fas) It's easy for .ARX files: (vlax-safearray->list (vlax-variant-value (vlax-invoke-method (vlax-get-acad-object) 'listarx)))
View 9 Replies
ADVERTISEMENT
Aug 2, 2012
This is related to AutoCAD 2005 only:
I have a custom menu file which is NOT located in the support path but rather is on a server drive for all AC 2005 user's to access. When I load this menu in AC 2005 and then restart, it is gone and has to be reloaded. This is happening for all 2005 users in this office. With AC 2009 we use CUI and that custom file is also located on the server, not in the support path, but the 2009 machines are working fine. It is only the AC 2005 users who keep loosing their menu item each morning.
I have done extensive searching on this and it appears to be a common problem but the thing which is also common to all the posts and articles I read on it is that none of them offer a resolution which actually works.
View 1 Replies
View Related
Oct 16, 2013
I am in the process of creating 2 lisp routines, one that loads Support file search paths on the network and one that adds support file search path locally. Each routine will be run depending on the ability of ACAD to find a file on the server. I noticed that when I add the new directories the default AutoCAD folders get replaced. I researched this and found that using the SETENV and ACAD I can include the default support paths.
The issue I am running into is that not all default folders are being added to AutoCAD when I used the ACAD variable. A plugin folder under Program Data is listed in the original install, but it is not listed when I add my directories and used the ACAD variable to add the default directories. The same thing happens when raster design is installed. The help folder and the install directory for raster are not carried over when using the ACAD variable.
I am attaching the coding for the lisp routine adding server paths. Is there some syntax I can add to tell it to append to the list instead of replacing the SFSP list?
(vl-load-com)
(setq files (vla-get-files
(vla-get-preferences (vlax-get-acad-object))
)
)
(setq SERVNM (getenv "servername"))
(setq SLSERV (STRCAT "\\" SERVNM))
[code].........
View 2 Replies
View Related
Jul 15, 2013
I have a list -
(setq List1 (list "Line A" "Line B" "Line C"))
I would like to add each item in an existing list to a new list -
(setq ListNew (list "This is some text" "This is more text"
the following is the part I can't figure out - it just adds the list to the list, not the individual items
(mapcar '(lambda (x) x) List1)))
I am looking for ListNew to be - (a list with 5 strings)
"This is some text"
"This is more text"
"Line A"
"Line B"
"Line C"
View 9 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
Aug 17, 2012
I have a list that contains data like this,
"Tree-01-08-AA5"
"Tree-04-12-QV"
"Tree-10-30-QS"
How would I go about sorting this list by AA5, QV, QS? I know how to use vl-sort and reverse, but I do not understand how I would go about this.
View 9 Replies
View Related
Aug 26, 2012
I have a list like ("a.dwg" "b.dwg" "c.dwg") and an filename "b.dwg"
I want to know if the file name is a part of the list. which function must be used for this?
View 5 Replies
View Related
Oct 13, 2013
I need to modify the code below.
When I run the command and write the scale, I need to change the name of the scale and the ratio automatically. The ratio should always be in the format "1: #", also the name of the scale. Maybe assigning more variables with "setq", I do not know.
(defun c:test ()(setvar "cmdecho" 0)(setq name (getint "
Type the scale you need:"))(setq ratio (strcat "1:" "0.1"))(command "-SCALELISTEDIT" "Add" name ratio "Exit")(setvar "cmdecho" 1)(princ))
View 6 Replies
View Related
Jul 11, 2013
Here's one that I could use on that i can't figure out:
I have a list of a bunch of descriptions that looks like this:
("00.02.00" "CTD01 Mainframe PT1 (top)" "GD01")
What I am doing is grabbing the middle item and i need to break this up into 2 lines. So, my code below grabs the first 3 "words" in the second item in the list and puts them in a list, but I need to convert this back to a string.
(setq desc6a (list (car (read (strcat "(" (cadr input6) ")" )))(cadr (read (strcat "(" (cadr input6) ")" ))) (caddr (read (strcat "(" (cadr input6) ")" )))))
I tried a bunch of ways but can't get it
View 8 Replies
View Related
Apr 25, 2013
I've been experimenting with lists and I'm curious about the fastest / easiest way to get the next element from a list:
Currently my best shot is to wrap (member 2 '(1 2 3)) with: (car(cdr (member 2 '(1 2 3))))
View 9 Replies
View Related
Jan 6, 2012
How to export to a txt file a list containg all the objects on the current layer and their properties?
To be precise, I would like to export the following items from a selection of plines:
- ObjectID;
- Start Point;
- End Point;
- Vertex Points;
- Width.
View 3 Replies
View Related
Jul 17, 2012
Here is the code snippet from my program, I am trying to build a associative list from two regular lists in the while loop. Does ""append " or "cons" only work for simple lists? Given attributeNameList attributeValTypeList which are always of the same length
(setq listCntr 0)
(while (<= listCntr (length attributeNameList))
(setq attrTagTypeAssnList (append attrTagTypeAssnList (list ((nth listCntr attributeNameList) (nth listCntr attributeValTypeList))) ))
(setq listCntr (1+ listCntr)
)
How can I dynamically build the association list.
View 2 Replies
View Related
Sep 17, 2013
I've created a list and want to subtract all the values within it from another variable, and assign it to a new variable. How do I do it?
Basically, I ask for ground level (assigned to variable G1), and then any number of depths beneath that (assign to list LVLLIST), and I want to return the value of the bottom point. So it's all the values in LVLLIST added together and subtracted from G1. And assign it to a new variable BASE.
For example,
G1 = 650.00
LVLLIST = (1.23 23.26 0.13 50.23)
(setq BASE (- G1 LVLLLIST))
View 2 Replies
View Related
Oct 7, 2011
In the example given I have two instances to show how unique the information can be.
I would like the left column of words to be some type of drop down or list so that the user does not have to type these for each line. I don't care if it's attribute, text, mtext, just whatever gets it done.
View 6 Replies
View Related
Dec 5, 2012
I have the following string of code, that I'll write in everyone's start-up suite. I'm able to retrieve a list of files I want to modify, for whatever reason. (One example, when plotting drawings with layouts, sometimes the shadeplot setting is wireframe, and not classic hidden, though it's been set up in our templates).
The huge question is, can I get a list of drawings to a variable in one drawing, and have access to that variable list, in the next drawing I open? I'll iron out the bugs on read-only statuses, or manipulating drawing states later.
(defun GetDrawings ()
(setq currentpath (getvar "dwgprefix"))
(command "pspace")
(setq DrawingList (dos_getfilem "Select a file" currentpath "Drawing files (*.dwg)|*.dwg|All files (*.*)|*.*||"))
(setq ListOfDrawings (cdr DrawingList))
(setq DrawingPath (nth 0 DrawingList))
[code]...
View 1 Replies
View Related
Dec 11, 2013
I want to make a list of layers due to their index (order) in the "layers combo box" in the AutoCAD. I prepared this:
(defun c:ListLayers ( / a b)(setq a(list(cdr(assoc 2(tblnext "layer" T)))))(while(setq b(tblnext "layer")) (setq a(append a(list(cdr(assoc 2 b))))));while);end
But, It's not match with the order of layers.
View 9 Replies
View Related
Feb 3, 2012
I'm looking for a lisp routine that will globally list all the values from a specific attribute tag within a specific block. The attribute tag is "COMMENT" and the block name is "FSD".
View 9 Replies
View Related
Aug 15, 2011
How can I determine what was selected in the pop-up box and then using that for 1 of 2 things, either 1) Turn off the Edit Box for Hole Spacing if the selected option is 1(which would be value = "0" of the popup list) or 2) Making the portion where it confirms that the Hole Spacing Edit Box is filled out so that if the Pop-up List displays 1, it doesn't check the Hole Spacing Box. Below is the DCL and LISP that I'm currently using.
Here is my current DCL:
questions :dialog {label = "Information for Program";: row {: column {: boxed_radio_row {key = "Galv";label = "Galv Slot Required?";: radio_button {key = "Y"; label = "Yes"; value = "1";}: radio_button {key = "N"; label = "No";}}: boxed_radio_row {key = "Bevel";label = "Is Leg to Face
[Code].....
If needed: AutoCAD 2013 User using Visual LISP for editing LISP and DCL files Also I have AutoCAD 2011 currently still available for us, but we are using AutoCAD 2013 for 99.9% of AutoCAD use
View 6 Replies
View Related
Jun 14, 2013
How can I sort an association list?
for example:
(setq lst '((1 . "s") (12 . "t") (-7 . "u") (0 . "v")))
should be sorted as:
((-7 . "u") (0 . "v") (1 . "s") (12 . "t"))
{ sort on: (car(assoc index lst)) value}
View 9 Replies
View Related
Feb 12, 2011
Searched NG and did not find anything.
Given a list remove from list if both (nth 0) and (nth 5) are duplicates in list
(setq dolist '
(("CABLE, MIL-C-24640/18D " "IAF" "A/R" "FT" "6145-01-224-9183" "-" "3XSOW-7" "C-LC(1), (2)")
[Code]....
View 9 Replies
View Related
Oct 31, 2013
I am unsure why my Lisp does not work.
(DEFUN C:Clear_values (/ GLBLS) (SETQGLBLS '(*DATEDRAWN* *DRAFTNAME* *JOBNUMBER* *OWNERNAME**JOBCOE* *PERMITREVDATE* *PERMITCONTACT* *HOMEBUILDER**SUBDIVISION* *ADDRESS**CITY* *STATE* *ZIP* *LOT#**PARCEL#* *NSCOORD* *EWCOORD* *STANDARDDETAIL#**SUPERNAME* *SALESMAN**GATECODE* *HOMEPHONE* *WORKPHONE* *ALTPHONE1**ALTPHONE2* *EMAIL1* *EMAIL2* *ACCESS**EXCAVATIONTYP* *EXCATDEMO1**EXCATDEMO2* *SKIMRUN* *AWLRUN*
[code]....
I've tried several options such as (mapcar 'set GLBLS "%%") but nothing happens, and with the above code nothing happens; the code only returns nil.
View 8 Replies
View Related
Aug 16, 2013
I'm making a program that reads a property file that follows the format:
"key=value" for each line on the text file.
One specific line has the key "file" and the value is some file path that includes a space.file=C:/my folder/my file.txt
Now I can extract what the key and value is for any given line in the file.However, I want to put all of the data into an Associative List so that I will not need to keep opening the file each time I search for information. I've been using the cons function in order to create a dotted list, which is successful. However I have an issue when I add this dotted list to the end of my associative list.
Suppose I have a key and a value already stored inside variables. Below I have two lines of code, first the dotted list portion is printed, and works as expected. The second line adds that dotted list to the associative list:
(princ "Cons: ")(princ (cons key val)) (princ "") ;Prints (file . C:/my folder/my file.txt)(setq assocList (append assocList (cons key val))) ;Error message here.
The error that I receive says "; error: bad list: "C:/my folder/my file.txt"..Here is the change:
(setq assocList (append assocList (list (cons key val))))
Now, the dotted list is inserted properly and looks like this after printing the whole associative list: ((version . 1.0.1) (file . C:my foldermy file.txt))
View 1 Replies
View Related
Oct 17, 2011
Is it possible to obtain a list of coordinates for view ports (with dxf codes or otherwise) similar to obtaining a list of (assoc 10) for polylines?
I'm aware I can get the center, width and height from the dxf codes, but what about for clipped view ports with irregular shapes?
View 2 Replies
View Related
Dec 20, 2011
how to work with safearrays so that I can modify a dynamic block property reporting tool that I found here on the forums. I’d like to take the following code and filter out the extraneous properties so that the user doesn’t get information overload. Here’s the code that I'm starting with – works nicely:
(defun c:dbinfo (/ obj v vval sal salnth count)
(setq obj (vlax-ename->vla-object (car (entsel "
Select Dynamic Block: "))))
(setq v (vla-getdynamicblockproperties obj))
(setq vval (vlax-variant-value v))
[code]....
So, how do I filter the safearray list (down two levels to property names) so I can remove origins and other unimportant properties? Here’s the two property names I am trying to filter out:
(or (= (car y) "Origin") (= (substr (car y) 1 8) "Position"))
I’m beating my head against the wall trying to figure out how to take sal and redefine it like:
(/= (or (= (car y) "Origin") (= (substr (car y) 1 8) "Position")))
Of course, that doesn't work with a safearray.
View 6 Replies
View Related
Aug 16, 2013
I found a function on JTBWorld named listPageSetups, which appears to be meant for listing the pagesetups that exist in an "open" dwg file (as I can get it work for the current dwg). So,
(1) Can this function be used to list page setups in another, un-opened dwg, and, if so, how?
(2) If the answer to (1) is No, is there a LISP way to get a list of page setups from another, un-opened dwg?
View 9 Replies
View Related
Jul 30, 2012
where I can obtain a freeware lisp routine that lists the lengths of all the polylines on a specific layer or within a selection set? I want to avoid list if possible as there are rather a lot of polylines!
View 2 Replies
View Related
Aug 5, 2013
I am looking for code to remove duplicate points (xy coords) from a list with a fuzz factor parameter.
View 1 Replies
View Related
Nov 20, 2011
I have two lists with lists inside:
((A) (A) (A) (B) (B) (B) (B) (C) (C))
and
((A 1) (A 2) (A 3) (B 1) (B 2) (B 3) (B 4) (C 1) (C 2))
I just want to make a list with lists that is:
((A 1 2 3) (B 1 2 3 4) (C 1 2))
I am guessing map car and lambda should come into play but i can't figure it out.
View 3 Replies
View Related
Jul 17, 2012
I have a list of (0 .4 .8 0 10). I want to convert every element of the list to string.
View 4 Replies
View Related
Aug 19, 2012
I have list like (C:projectspr0310.dwg C:projectspr0315.dwg C:projectspr03drawings17.dwg)
Want these three files deleted from C:projectspr03.
View 9 Replies
View Related
Sep 6, 2012
I am trying to import a list of customers from column A in an Excel file into a list for a popup_list for my Drawing Properties DCL. I am having trouble finding information on how to do this.
Basically: Load the file, (workbook through active sheet: vlax-get-property)
(setq xlSheets (vlax-get-property xlBook 'WorkSheets) )
Then, how do I get it to put column A properly into a list for the DCL?
View 1 Replies
View Related