I'm attempting to create an easier way to change layer colors of nested linework by selecting the linework and having the ACAD index color dialog box appear to select the replacement color.
defining the "ic" variable;
(defun c:clc (/ ent ent_data ic ent_lay) ;change layer color(setq ent(nentsel)) (setq ent_data(entget(car ent)))(setq ic ;index color(cdr(assoc 62(ACAD_COLORDLG))))(setq ent_lay(cdr(assoc 8 ent_data)))(command "-layer" "c" ic ent_lay ""))
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?
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))
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.
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
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.
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.
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)))
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.
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".
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
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:
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))
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:
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?
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!
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)
I need to get the layout list in reverse order. How to do this? My plotter outputs prints face up and I wind up with a stack of drawings in reverse order - If I can cycle through the tabs in reverse order they will wind up in the correct order in the print room!