AutoCAD 2010 :: Using Lisp To Add A String To Each Item In List?

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


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Add String To Each Item In List Using Lisp

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

AutoCAD Visual LISP / AutoLISP :: List To String

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

AutoCAD Visual LISP / AutoLISP :: Convert Every Element Of List To String

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

AutoCAD Visual LISP / AutoLISP :: Convert List With String Or Lists Of Strings To Text

May 22, 2013

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).

Example 1-

(setq List1 (list "Col1-Line1" "Col1-Line2" "Col1-Line3-longer" "Col1-Line4"))
(AlignText List1)
returns
"Col1-Line1"
"Col1-Line2"
"Col1-Line3-longer"
"Col1-Line4"

so no padding needed

Example 2 -

(setq List2 (list (list "Col1-Line1" "Col1-Line2" "Col1-Line3-longer" "Col1-Line4") (list "Col2-Line1-longer" "Col2-Line2" "Col1-Line3" "Col2-Line4")))
(AlignText List1)
returns
"Col1-Line1        Col2-Line1-longer"
"Col1-Line2        Col2-Line2       "
"Col1-Line3-longer Col2-Line3      "
"Col1-Line4        Col2-Line4      "

 Example 3 -

(setq List3 (list (list "Col1-Line1" "Col1-Line2-longer" "Col1-Line3" "Col1-Line4") (list "Col2-Line1-longer" "Col2-Line2" "Col1-Line3" "Col2-Line4") (list "Col3-Line1-longer" "Col3-Line2" "Col1-Line3" "Col3-Line4")))
returns
"Col1-Line1        Col2-Line1-longer Col3-Line1-longer"
"Col1-Line2-longer Col2-Line2       Col3-Line2       "
"Col1-Line3-longer Col2-Line3      Col1-Line3       "
"Col1-Line4        Col2-Line4      Col3-Line4       "

View 5 Replies View Related

AutoCAD 2010 :: Lisp For Extract Number Value From Between Text String

Sep 5, 2012

I have text with number string. ( eg:  weight   50 kg,   xyz weight   362 kg)i want to extract the number values of  "50" &  "362"  from the text string.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Changing String Of Text / Multitext / Dimensions To Another String

Nov 16, 2012

i failed to find one which would change string of a text to other for all types of objects. I mean it was usually either only multitext, or only text, dimensions or attributes.creating one which would change in abt 200 drawings:

-001

-002

-003

to:

-00001

-00002

-00003

in attributes, text, multittext, leaders, multileaders, dimensions..... at the same moment?

It is meant to be used in ScriptPro (by loading lisp in script).

If not possible, then can also open each file and run the lisp in each of them - still would save lot of time.

View 4 Replies View Related

AutoCAD 2010 :: LISP File To LIST All OBJECTS On A Drawing?

Feb 24, 2012

I have to list all object data on some 4000 drawings. The drawings have been created in an unkown version of autocad and are electrical in nature. It would be great if a LISP file could be created to extract all of this too individual Excel or text files.

View 1 Replies View Related

3ds Max :: Shader List (Volume) Duplicates Last Item In List

Nov 4, 2011

I use a setup with Shader List (Volume) with two mists. One regular and one to blur out the horizon. After working on the scene for some time I notice that the shader list now contains eight copies of the last shader. I think I would remember if I did that. So, whats up with the shader list?

View 1 Replies View Related

AutoCAD Inventor :: Where To Find ControlDefinitions Cmd List In Red String

Jul 14, 2013

Where do I find ControlDefinitions Cmd list in Red String.

The question is link of this: [URL] .....

View 1 Replies View Related

AutoCAD Inventor :: Write Text String To Parts List With ILogic

Mar 5, 2013

I'm trying to create an iLogic rule that will print a text string to a cell or coloum of a parts list in inventor.

My code so far...

Sub Main()
On Error Resume Next
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
[code]......

I want to print what is in the Message Box into a cell in the parts list, and i am stumped. The cell i am trying to print to is a user property in the Parts List.

View 1 Replies View Related

AutoCAD Inventor :: ILogic Rule To Print String To Parts List?

Mar 5, 2013

I am trying to make an iLogic rule that gets mutliple strings from different places, and prints them to a user property in the Parts List.

My ultimate goal is to print the drawing number, sheet number and the item column value to the user property with the format being...

"XXXXX-X-X"

So far, i can get the drawing number from an iProperty and the sheet number easily. But im getting stumped on obtaining the item coloum value and printing it to the same row.

This is what i have so far...

Dim DWGNUM As String = iProperties.Value("custom", "DWG Number")
SheetNumber = Mid(ThisDoc.Document.ActiveSheet.Name, InStr(1, ThisDoc.Document.ActiveSheet.Name, ":") + 1)
MessageBox.Show(DWGNUM+"-"+SheetNumber, "DXF Number")

And print the message box output to a column in the parts list

View 7 Replies View Related

AutoCAD Civil 3D :: Creating Pay Item List

May 13, 2013

I am having trouble understanding "Exercise 7: Creating a pay item list". How to find video of how this is created, or information to better understand the .csv and .xml utilized by QTO better. I am new to editing any .xml codes.

View 2 Replies View Related

AutoCAD Inventor :: Fill Multivalue List In ILOGIC With Produced String (FILTER)

Nov 4, 2011

I try to filter an Excel List and therby fill certain Multivalue Parameters with the filtered data.

The filter works fine an provides me a string looking like the sytax for the MULTIVALUE.SETLIST command.

B6string = FilterReturn  &  Chr(130) & B6String = 75‚80‚250‚65‚45‚250

Unfortunatly this string gets exactly as ONE entry in the Parameters Value listing !

MultiValue.SetList("B6_Lochbild_Länge", B6String)

I also tried

MultiValue.List("B6_Lochbild_Länge") =  New Integer () {B6String}

and also

B6string = Chr(148) & FilterReturn & Chr(148) &  Chr(130) & B6String

with the same effect !

View 2 Replies View Related

AutoCAD Inventor :: Write Text String To Parts List Column With ILogic

Mar 5, 2013

I'm trying to create an iLogic rule that will print a text string to a cell or column of a parts list in inventor.My code so far...

Sub Main()
On Error Resume Next
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
[code]...

I want to print what is in the MessageBox into a cell in the parts list, and i am stumped.The cell i am trying to print to is a custom property in the Parts List.

View 3 Replies View Related

AutoCAD Inventor :: Item Numbers Blank In Parts List?

Feb 19, 2013

For some reason the item numbers in my parts list are blank. All the other information populates. 

I've gone to the assmebly and varified that the BOM tabs are active and there are numbers in there. 

If I inser the parts list as 'legacy' it works fine. 

I can't use the renumber function, it just makes all theh item number boxes go yellow in the parts list box, 

Inventor 2013. 

View 9 Replies View Related

AutoCAD Inventor :: Parts List Numbering Skip Item 8

Jul 9, 2012

When I created a parts list this morning the list started with item 2 and skipped item 8 as shown below.

why would it do that? I know I can renumber the list, but then when I expand the subassembly to show the subassembly parts, they stay numbered 10.1, 10.2 ect. even though the subassembly has become item 8 with the renumbering. If I expand the subassembly before renumbering, I loose the indented numbering format and simply get numbers 1 to 18. True I could manually renumber all the components, but what would be the reason the parts don't come into the parts list numbered sequentially to start with?

View 4 Replies View Related

AutoCAD Inventor :: Parts List Line Item Visibility?

Sep 13, 2012

Is there an application or document setting that will make the default state of a row in a linked excel file used in a parts list default to "off" (not visble)?

More specifically, make this apply to added rows.

We have finish schedules in excel that everyone links a parts list to whenerver they need to display a finish schedule on the idw. However, when we add rows (new finishes) to the the excel finish schedule, they get displayed on the idw parts list next time the idw updates wether they are needed or not. Our practice is to only show finishes that are used on the drawing - so frequently a large portion of the whole finish schedule needs to be set to "off" or invisible.

View 3 Replies View Related

AutoCAD Inventor :: IDW Part List Item Numbering For IAssemblies

Jan 30, 2013

I have created an iAssembly which contains 4 assembly variations. I now want to create an assembly drawing for these variations.

In this case all my assembly variations will have the same assembly part number as essentially they are all the same assembly except for a few "change over parts".

I intend to have one drawing with multiple sheets. Each sheet will have one variation of the assembly on it with a BOM for that specific variation. The problem I am having though is that the drawing BOM for each variation are linked and as a result each drawing has an inconsistant item numbering (for someone in the workshop who doesnt understand the CAD package and iAssemblies - They ask the question: Why are you skipping item numbers in the BOM's)

Is there any way I can get each BOM to show the item numbers sequentially? I tried editing the drawing BOM item number but the problem is that method propogates the item number changes to all the other BOM's as well.... (It is also tedious AND in my opinion it is generally bad practice to edit the BOM at the drawing level)

View 1 Replies View Related

AutoCAD Inventor :: BOM Renumbering And Part List Sort By Item (iLogic)

May 15, 2013

i = MessageBox.Show("Do you wish to Renumber & Sort BOM?", "My iLogic Dialog", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) If i = vbyes ThenTrace.WriteLine ("INV - Transfer; User Selection; Do you wish to Renumber & Sort BOM? - YES")'Renumbers & Sort BOMoPartsList1.Renumber oPartsList1.SaveItemOverridesToBOMoPartsList1.Sort("ITEM") Trace.WriteLine ("INV-ExternalRule - Renumber & Sort BOM#")Else if i = vbno Trace.WriteLine ("INV - Transfer; User Selection; Do you wish to change Renumber & Sort BOM? - NO")End if

what i want to do, is renumber the BOM by (001) then go to part list and sort by item.

View 9 Replies View Related

AutoCAD Inventor :: Add Item To Multi-Value-List Of User Parameter (2012 API)

Jan 3, 2014

IV2012 API with VB:

How can i add an item to a Multi-Value-List of an existing User Parameter in Inventor2012 (Accessing API with Visual Basic) ?

My idea is for example:

uParams.Item(i).ExpressionList.AddItem(As String)

The problem is, that such a function "AddItem" doesn't exist.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Convert To String ACL

Jun 6, 2012

I have a list that is "acl", I would like to convert it to a string "acl", everything that I have read uses alot of code. Does this  really take that much code to do?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add List To A List

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

AutoCAD Visual LISP / AutoLISP :: Remove Portion Of A String?

Feb 22, 2012

I am trying to make this: L:Engineering-208037SURVEYDRAWINGS turn into this: L:Engineering-208037DRAWINGS

I am using the dwgprefix and it returns the first string and i want to make it in the second string as a new variable or replace the old variable so i can use it in a save as routine i am working on.

The problem is sometimes them project number (0208037) will be longer or shorter so i can't use the substr command

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Text String From Mtext?

Aug 20, 2013

I'm looking for a function to return the actual text from an mtext object.if there's a carraige return I wish to replace it with a space.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Sorting A String Of Numbers

Aug 31, 2012

acad_strlsort will sorts strings, but what if my list looks like

("1" "2" "3" "10" "11" "12" "20")

i am sure i have seen it done ina simple way using vl-sort or vl-sort-i

but am not able to find...

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Check String To Set Up A Dimstyle

Nov 18, 2011

I've been working on a lisp to set up basic settings such as text styles, dim styles, discipline specific layers and things of that nature.

I have a prompt to ask for a discipline designator as a string.  I want to have an If statement or a conditional to read that string and check for a "C" if it finds it I want to have it set up a dimstyle to decimal feet ect and if not do it as architectural units.

This is just a test lisp that I'd like to add to the main one listed above...  

(defun c:test(/ disc dsnm dsna)

(setq disc (getstring "
Discipline (G,C,S,M,E,CP): "))                ;Prompt for Discipline
(setq ds (getint "
Dimscale Factor: "))                                          ;Prompt for Dimscale
[code].......

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Passing String As Variable?

Jul 9, 2013

I would like to use a string as a variable if this is possible. I've got:

new-pl-lay (as a variable that holds layer name "UGL_PL_NEW")

first-cable (as a string that holds "new-pl-lay")

I'd like set the current layer to "UGL_PL_NEW" by using the first-cable string.

Something like:

(command "_.layer" "m" (read first-cable) "")

View 8 Replies View Related

AutoCAD .NET :: Pass String With Quote Marks To Lisp Command

Aug 10, 2012

I have created a string:

strAttValue = ("3/16""=1'-0""")

or alternatively I've tried:

strAttValue = ("3/16" & Chr(34) & "=1'-0" & Chr(34))

that I would like to pass to a lisp with the format:

(defun lispTest ( strAttValue / )

but when I do it errors with "Too many variables." The passing method is as follows:

acDoc.SendStringToExecute("(lispTest" & Chr(34) & strAttValue & Chr(34) & " ) ", True, False, False)

If I get rid of the quotes in the original string it works fine, but the quotes are needed.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add Predetermined String To Each Layername In DWG

Aug 30, 2011

I'm working on a LISP function that adds a predetermined string to each layername in the dwg.

I came up with this:

(SETQ prefix "A-_82-_")
 (TBLNEXT "LAYER" T)
 (WHILE (SETQ la (TBLNEXT "LAYER"))
  (SETQ old (ASSOC 2 la)
     new (CONS 2 (STRCAT prefix (CDR old)))

[Code] .....

The line  (princ "
la is: ")(princ la) (princ "
") is thrown in to enable me to see the result of the while function, and is to be removed from the final version.

Now, everything seems to work fine, as the princ shows on the acad textstcreen.

Yet, when I check the layer palette, all layernames remain unchanged.

My guess is that I should use some other function then ENTMOD or ENTUPD to change the layertable, but I'm at a bit of a loss as to which function is required.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Moving Attribute Block With Tag String Name

Dec 20, 2013

I have a lot of attribute blocks in my drawing which i want to move them one by one

so , here is what i want to do :

I have numbers (or texts) in my work area and this numbers also exist in my attribute blocks .. i wanna move my attribute blocks with tag name value reference to my specify area if tag name values are matching with text or numbers in this area .. every block will check my selected tag string and will be move on matching text in my work area.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved