AutoCAD Visual LISP / AutoLISP :: Convert List Of Numbers To A Range Of Missing Numbers
Jul 18, 2013
I have subroutine that retrieves a list of detail numbers in a drawing. Sometimes there are missing numbers. I am looking to find a list of any missing numbers.
Example -
(setq List_DN (list 1 2 3 5 6 7 10 11 12 17))
Missing numbers are - 4,8,9,13,14,15,16
I would like a subroutine to take the List_DN are return the following missing numbers as text
Lisp file to get serial letters and numbers from existing ones,
I got a lisp file (attached) from experts in the form which does generate serial letters and numbers from existing ones.
The issue with this lisp file is that it doesn’t give the opportunity to choose the direction of numbering (top to bottom/bottom to top/left to right/right to left) as shown in the screenshot below
How this lisp can be developed to give the user the chance to choose the direction of numbering?
I have draws with a a lot of layouts.In each layout, there is a block (CARTOUCHE) with a an attribute (PAGENUMBER)
I am looking for a way to select the block in my first layout, indicates a number for my attribute (PAGENUMBER). The lisp will automatically increase the attributes of the next others layout. How can I start this lisp.
I'm looking for a lisp routine that will draw a line between all matching numbers that are repeated 3 times or more in a selection.I'm using AutoCad 2012.
I have an opportunity to make a good impression at a new job, but ive never had the initiative to learn how to write a lisp routine. at my work we make walk-in coolers and freezers. these coolers are modular with a standard wall piece measuring a certain length. these wall sections have to be numbered sequentially. is there any way to automate this? sometimes we get change order from the client and it means going back and manually changing multiple texts (sometimes in the hundreds), but i thought if there was a way these wall sections could be scheduled somehow that when a new wall panel is inserted in the beginning of the sequence it would update everything after it automatically.
I have a data structure called LayerList in the format [LIST "LayerName" "Linetype" Thickness Color]I then use the following piece of code to go through the structure selecting polylines and converting all polylines on a given layer to the correct thickness
(foreach layr layerlist (setq player (car layr)) (if (setq ss (ssget "x" '((0 . "*polyLINE") (8 . player ) ))) (command "pedit" "m" ss "" "w" 0.15 "") (princ " No polylines exist!") ) )
However all i keep getting is Bad SSGET list value at the command line,
Someday the light bulb is going off and I will understand mapcar and lambda. However.....I have a program that reads an excel file sheets. Sometimes the sheet only has 1 column, sometimes 2 or more.
I need to convert the saved values from the sheet to a list with the text spaced evenly. Unfortunately the text lengths vary. I would like a subroutine to pass the list to and return a list of strings with text aligned with padded spaces allowing for the longest text in each column. I am using the new list in a dialog box with fixed_width_font=true (so columns align).
I would like to use the if else parameter in iLogic to set up a range, but I'm not getting it right.
What should happen:
if the variable 'breedte' is:
- 0 up to 3800; thats OK
- 3800 up to 4000; thats not OK, use 3800 instead
- 4000 and up; thats OK
Therefore I wrote this script, but when I enter a number between 3800 and 4000 (like 3900), the MessageBox appears (thats good), but the size of my solid results in 3900, instead of 3800.
breedte = InputBox("What is the breedte?", "Hoofdmaten", "")Parameter("skelet.ipt.breedte")=breedteIf breedte <= 3800 Then breedte = breedteElse If breedte >= 4000 Then breedte = breedteElse If (breedte >= 3801) AndAlso (breedte <= 4000) Then breedte = 3800 MessageBox.Show("This breedte is not possible." & hoogte & vbCr & "The value of 3800 will be used instead.", "Problem message", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk) End If
The command for Creating Lines by Specifying a Range of Point Numbers makes 3D line segments. Is there an option to make a zero elevation polyline running through cogo points that are 3D (the 3D line segments occur even if the cogo points are set to flatten elevation)?
I am trying to link my parts list to a drawing however all balloons have different numbers.
I open the assembly and check everything out from vault I open my bom and change item numbers. When I get back to my drawing and apply for auto balloon I get completely different item numbers in my balloons. We just updated our software to a new 2012 version so it's maybe something with set up.
Is there a way to sync callout numbers to correspond with note numbers. When I add or delete notes in my drawings it takes to much time to update the callout number in the drawings. I need to figure out a way for the note and corresponding callout to change at the same time.
For those who are familiar with the Ultra-Pipe Program, when I open a drawing from Ultra-Pipethe title layer is updated by the kbupdate.lsp file and the drawing decription (title Layer) is updated with the Circuit ID and TML range. Referencing the attached pdf, you can see that this would be misleading in some cases. I need the description in the title block to be updated with the drawing name instead.
We have changed the default layer colors before in the kbupdate.lsp so I know it's not impossible. I am 99% sure that the changes needed for the problem above would be in the same file.
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?
I hereby have a school note report from my little brother. He told me he had some bad notes in his last period and I would like to make a fake copy of it.
Basically, I scanned his 3th period notes and I would like to change some and add some
How you can remove numbers and add new ones over it and add numbers with the same digital code used on the old ones to put those in empty notes
I just had an internal request for this and I had to look it up. So I'll share what I found and have a place to find it myself next time.
One way to do it is to select a COGO point to bring up the COGO Point Contextual menu tab. In COGO Point Tools you can select List Available Point Numbers.
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)))