AutoCAD Visual LISP / AutoLISP :: Export Text In Ascending Sort

Jun 5, 2012

This routine select a lot of object texts and export the list to file (.TXT)

I want to export this list in ascending sort.

e.g. : H1, H2, H3, H10, H20, HT1, HT2, HT10...

How to change it to do this?

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun c:TXOUT (/ elist en fn fname i ss txt)
(setvar "cmdecho" 0)
(prompt "
* Text file written to directory of current drawing *")
(if (setq ss (ssget (list (cons 0 "TEXT"))))
[code]..... 

View 9 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Export Text To Excel

Jun 14, 2009

how create lisp convert text (from drawing) to excel

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Sort Association List

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

AutoCAD Visual LISP / AutoLISP :: Export Title Block Attribute Text

May 9, 2013

How to export title block attribute text .. in a order from different layout .? file ext .xls or .txt  i got a tool named Autocad Automation tool but it not work very well autocad have data extraction - its also came all text .. and not in order .. can we develop the any lisp for that ?.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Sort Through A Database And Rename Layers

Apr 5, 2013

I'm new to working with scripts and have played with it a little bit but my knowledge is severly lacking, I picked up script pro and have had some success batching simple commands.

What I have is a large database with differing layer convensions that I want be able to run a script that will open rename layers save and close, the layers are not of the same name but similar enough that I could set peramiters for less then a duzon layer names and catch my target then rename it to a standard, for example "A-wall exterior" to "A-WL-EXT", a simple enough command but within the database the "A-wall exterior" could be one of a duzon simmilar names.

My thought was to run the -rename la "layername" "layername" qsave script but when the original layer is not found it gets stuck untill script pro times out and fails. If there is some way to search out names and once found rename that would work.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Export TIME Command Results To Text File

Oct 22, 2011

Run TIME command and then take the resulting text and save it to a file.

Ideally, the text file should be named based on the drawing name. I know there's ways to write text to a file but I haven't had any luck taking the output of a command and exporting it.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Sort List Of Lists By Size Of Units?

May 2, 2013

I am trying to sort a list of lists by the size of units.

Here is the unsorted list -

(setq List_Blocks
  (list
    (list "10x10" "UNIT DOWN-CC" 56)
    (list "7.5x10" "UNIT DOWN-CC" 20)
    (list "5x5" "UNIT DOWN-CC" 34)
    (list "10x15" "UNIT EXTERIOR" 32)
    (list "5x10" "UNIT DOWN-CC" 31)
    (list "10x20" "UNIT EXTERIOR" 24)
    (list "10x30" "UNIT EXTERIOR" 13)
    (list "10x25" "UNIT EXTERIOR" 2)
  )
)

I would like the list sorted by the first number before the "X" and then by the second number after the "X".

Example of sorted list -

    (list "5x5" "UNIT DOWN-CC" 34)
    (list "5x10" "UNIT DOWN-CC" 31)
    (list "7.5x10" "UNIT DOWN-CC" 20)
    (list "10x10" "UNIT DOWN-CC" 56)
    (list "10x15" "UNIT EXTERIOR" 32)
    (list "10x20" "UNIT EXTERIOR" 24)
    (list "10x25" "UNIT EXTERIOR" 2)
    (list "10x30" "UNIT EXTERIOR" 13)

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Export GPS Coordinates To CSV?

Dec 7, 2013

I am looking for a method to export all the GPS coordinates which have been assigned to each point along with the properties of that point to an excel csv. In our drawings, there are multiple columns and each column has four points and each point has X,Y,Z coordinates. I want to export all this information to an excel sheet.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Export To DGN For Use In Batch?

Nov 11, 2011

I am trying to make a lisp to export to dgn for use in a batch. I have tried the following but get hung up at an "invalid path" error. I think I am not passing to -dgnexport a path in the correct format.

(defun c:deport()
(setq fname (getvar "dwgname"))
(setq fpath (getvar "dwgprefix"))
(setq dgnname (vl-string-right-trim "." fname))
(setq dgnnamenew (strcat fname ".dgn"))
(princ dgnpath)
(command "-dgnexport" "V8" dgnnamenew "master" "standard" "C:ProgramDataAutodeskACA 2011enuTemplateAutoCAD
TemplatesV8-Imperial-Seed3D.dgn"))

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Export Data From DWG To Excel?

Sep 4, 2012

I have Export data from dwg to notepad lisp programe. But i need lisp programe for Export data (Easting,Northing and Level) from dwg to excel.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Creating An Export Command?

Feb 11, 2013

I am attempting to create a export command for our surveyors that deletes all there point layers and seal layer, then audits and saves the file before opening the etransmit command.

Below is what I currently have.I know there is a better way to do this, but it is above my programing skill right now.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SURVey export(defun C:SRVY () (command "-laydel" ; Delete Survey data "Name" "F0" "Name" "F1" "Name" "F2" "Name" "F3" "Name" "F4" "Name" "F5" "Name" "F6" "Name" "F7" "Name" "F8" "Name" "F9" "Name" "F10" "Name" "F11" "Name" "F99" "Name" "SHEET-SEAL" ENTER "YES" ) (command ".audit" "y") ; Audits file (command "_qsave") ; Save changes (command "-etransmit" "Choose Setup" "ACAD2010" "Create transmittal package" ) (princ))

AutoCAD Civil 3D 2012 (Primary), 2011 by contract.

Dell Percision T3500: MS Windows 7 64-bit SP1; Intel Xeon CPU W3505 @ 2.53GHz, 12.00 GB RAM, NVIDIA Quadro 600

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Export Data From DWG To Excel

Sep 4, 2012

I have Export data from dwg to notepad lisp programe. But i need lisp programe for Export data (Easting,Northing and Level) from dwg to excel.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Export Parts Of Drawing To Another DWG

Oct 1, 2012

i have one big pipeline drawing and need to "split" it into smaller drawings..there are layers, v500, v250, v100 that represent size of pipeline.i'd like to extract all elements from layer v500  to drawing v500.dwg, after that v250... etc.

problem is that i would select only elements from v500, erase all other and than save it as v500.dwg... and then what? undo all and repeat everything with another layer?

is there a way to copy elements to another drawing and save and then return to original drawing and execute another set of commands?

View 9 Replies View Related

Lightroom :: 5.2 - Sort (ascending / Descending) Keywords In Library Filter Default Columns?

Sep 26, 2013

How do you sort (ascending/descending) keywords in Library Filter Default columns?  Lightroom 5.2.  Mine begin with Z; I have seen others that begin with A.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Export Data To Any Database Application?

Apr 19, 2013

I would like to save the data generated by LISP program at command prompt area to any data base app or any simillar app from where I can retrieve the stored data again in autocad for further usage. 

For example, A LISP program generate the result as shown in above Fig. I would like to save the data of step 5, "Shear force in tonnage is : 50.868" to any database application or any simillar one from where I can retrieve the stores data for further usage.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Dimension Export Routine Modification?

Dec 7, 2012

Found this routine online and am hoping to modify it to my needs, just not sure how to proceed.

It exports the text out of the dims into an excel file, the issue I have is that it automatically opens a new book every time you run the lisp with the original workbook open.

I am trying to get it to automatically insert the next set of numbers on the row below the first pull.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Select Several Plines And Export Their Vertexes

Jun 29, 2012

Yesterday I post the message "Exporting pline and text" which turned out to work realy well.

However I need something else...

I need to select several plines and export their vertexes (as it is already done) BUT I also need to select SEVERAL texts and export them as well as their insertion point coordinates.

I tried with the code below but without any success... It gives the error "; error: ActiveX Server returned the error: unknown name: "TEXT"" This happens after selecting some texts and hiting enter.

Here is the

(defun c:zi5 ( / f i o s ss obj objdata texto texto_f nomebase nome_zi tx1 iPt)(vl-load-com)(setq nomebase (getstring "
Enter name for file:"))
(setq nome_zi (strcat "D:" nomebase "_zi.txt"))
(princ "Select your plines...")
(if (and (setq s (ssget '((0 . "LWPOLYLINE")))) (setq f (open nome_zi "w")) )

[Code]...

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Multiple Polyline Export Challenge

Dec 20, 2011

I have been searching for a way of exporting multiple polyline or spline coordinates to txt file and all I can find is ones that write out as a single continuous list of coordinates with nothing denoting which one is which.

I really need it to be able to export each polyline as a group, and I would also love for it to be able to include the number of points and name of the layer e.g. :

polyline 'number of points' 'layername'
0.0 0.0 0.0
1.0 1.0 0.0
2.0 2.0 0.0
polyline 'number of points' 'layername'
0.0 0.0 0.0
1.0 4.0 0.0
2.0 8.0 0.0
and so on.....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Export / Import Attribute Values And Its Color

Apr 24, 2012

There is a BLOCKA that I'd like to extract its attributes - Tag and Color - into an external format (excel).  There after, I'd like to import it into the drawing and based on its color attribute value, change the value to that color in the drawing.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Export Drawing Attributes To MySQL Server?

Jun 18, 2013

My problem: I need to extract attributes from CAD files and export the data into MySQL type databases in order to compare the CAD data with other database data. Ideally the task needs to be done with a routine script that processes large sets of CAD files and data. 

I would like to know: Can this be done?Whats the best way to script this or code this with an API? Is there a way to run this script on a server machine without AutoCAD installed? (Not that I'm trying to avoid using AutoCAD in general, of course the program was used to create the files, it just seems silly to install it on a server for one task)Is this script relatiavely simple, or would it require large amounts of time and/or an expert?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Selecting Multiple Objects To Export Their Coordinates And ID

May 24, 2013

I am just starting learning lisp, And I am looking for a fast way to select multiple objects (usually circle) and export their coordinates and ID into a excel sheet through lisp programming.

As you might see in the attached drawing, the red circles are objects wanted. I have been trying to export their coordinates as well as their IDs in grids, e.g D28, Easting:  Northing:  . I still haven't found a good way to export ID for each circle.

As my code doesn't work, I wonder what's the most effective way to detect errors in lisp

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Existing Text To Keyboard Entry Text

Jun 21, 2012

I have two attributes "REVN" and "REVD" in a block "ATT" that I would like to change (globally preferably) to the following.

(1) Existing text to keyboard entry text.

(2) Colour from existing to 10

I am a bit lost in the (command "-attdef" .......)

(defun c:atc ()
(setq rev (getstring "Please enter review"))
 (setq dat (getstring "please enter date"))
 (command "-attdef" .."ATT".."REVN"....."c" "10")..)
 (command "-attdef" .."ATT".."REVD"....."c" "10")..)

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Text Won't Wrap In Text Window?

Oct 8, 2013

When I click on an object to retrieve it's extended data, the data keeps writing to the right, it does not return to the next line, when the text approaches the end of the screen.  Very difficult to analyze information.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Text Width Before Text Creation

Mar 2, 2013

I want to know is there any formula/calculation for the width of text object before creation/insertion? At now I used approximated width size via a simple .
 
(Defun GetStrWidth (str H W) (fix (*(* H W) (strlen str))));;usage: (GetStrWidth "This is a Text." 2.5 0.8);;H: TextHeight; W: width factor. 

I know that for the existed text in drawing I can use textbox command, but for the texts that has not been created, what can I do? Is there any formula/calculation depends on font name, text height and width factor?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Move All 3.5mm Text To Layer Text 3.5

Sep 12, 2012

We are using autocad 2012.

Is there a way to move all 3.5mm text to layer text3.5 and move all 5mm text to layer text5.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Find All Text In Selected Items And Swap Text

Oct 25, 2012

A program that prompts:"select objects:" then I can select some objects like as text, line, circle,... after that program find all texts in selected items and swap text

swap means:   xxx/yyy ===> yyy/xxx ;    "/" is a divisor

swap function for one text is here:

(defun c:swap ( / pos ent el txt)
(vl-load-com)
(if(null #div#)(setq #div# "/"))
(setq #div#
(if(=(setq tmp(getstring(strcat "
Divisor character: <"#div#"> ")))"")
#div# tmp
)

[Code]....

but I want a program to prompt me like this:

(prompt "Select objects:")(terpri)
(setq a (ssget '((0 . "TEXT"))))

and gets divisor char </>:

after that:

(setq n (sslength a))
(repeat n

....

)

repeats n times, n=number of texts in my selection

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Using TEXT Not MTEXT To Create Multiple Lines Of Text?

Oct 4, 2011

3rd party tool which didn't match our scaling needs the file is a fas so I have tried to reverse engineer the whole function using trial and error. The following code works perfect except we need multiple (x amount) lines of text I have at current the M txt function which mimics and is effective for today however we need all lines to be individual.

I’m playing round with a loop but how to achieve my need..He had a 3rd party tool which didn't match our scaling needs the file is a fas so I have tried to reverse engineer the whole function using trial and error.

The following code works perfect except we need multiple (x amount) lines of text I have at current the M txt function which mimics and is effective for today however we need all lines to be individual.
 
;Starting lisp program...(defun C:REDtext ();Creating Layers (if non existant)...(command "layer" "m" "TEKST-1.5mm" "lt" "continuous" "" "c" "1" "" "");Memorising previous layer...(setq MYOLDLAYER (getvar "clayer"));Setting requierd layer...(COMMAND "LAYER" "SET" "TEKST-1.5mm" "");Setting variable "MYHEIGHT" to "DIMSCALE" x 2...(setq myheight (* 2 (getvar "DIMSCALE" )));Requesting and storing usser defind point...(setq MYPOINT (getpoint "Start punt :")); Requesting and storing user defind text...(setq MYTEXT (getstring T "Nieuw tekst :"));Placing text...(command "text" MYPOINT MYHEIGHT "0" MYTEXT); Restoring previous layer...(setvar "clayer" MYOLDLAYER);Closing lisp program...)

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Select Multiple Text To Heal Instead Of Single Text?

Aug 1, 2013

this code is used to fix specific font but its problem that it will prompt you to select single text 

i need to make it to select multiple text so it saves me a lot of time, 

;;; Process Individual request
(defun cht_ProcessIndividual ()
(setq sslen (sslength sset))
(while (> sslen 0)
(setq temp (ssname sset (setq sslen (1- sslen))))

[Code]...

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Changing Text Formatting Style Inside All Text Contents

Aug 4, 2013

I have inside every text,Mtext contents different text style like Arial_1 , Arial_2.

How i can give all the contents inside one style ? the normal procedure i will enter inside text to enter editing mode and changing text format style one by one. I  want it once.

I want to save my routing of entering every text to change its content text style.

(Notice:select all from outside without editing mode will not do the job)

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Z Value From Text

May 10, 2012

I have text objects with the same Z value and I will select as follows:

(setq sstxt (ssget '((0 . "TEXT")(8 . "APS-text"))))

How to store this value in another variable "zvalue" to apply to:

(command "change" "select text objects" "" "_p" "_e" zvalue "") ?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Automatically Export Attributes From Selected Blocks To Defined Txt File

Oct 3, 2012

How to create a lisp to automatically export attributes from selected blocks to defined txt file without having to everytime confirm the file name, location and if the file shall be replaced?

Meaning is that I often export attributes to txt file for further use. It is always the same file (I just overwrite it always).

The way I do it now is selecting blocks, using ATTOUT command, then going to the desktop, selecting ATT.txt file and confirming that it is to be replaced.

Is there a way to make lisp or script that will just do all it in at once?

I found on forum such a lisp as below, but it exports all ablocks on drawing and it exports to txt file which is located in same  place as drawing and with same name as drawing. Tried to modify it but without success:

(defun cut-att ()
(load "attout")
(setq fna (strcat (getvar "dwgprefix")
(acet-filename-path-remove (acet-filename-ext-remove (getvar "dwgname")))
".txt"
))
(setq ss (ssget "X" '((0 . "INSERT") (66 . 1))))
(bns_attout fna ss)
)

Same question for ATTIN - I use attin and always same file name from same location - how to automate it with one command?

View 9 Replies View Related







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