Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

xl coordinates to table

9 REPLIES 9
Reply
Message 1 of 10
richie_hodgson
1065 Views, 9 Replies

xl coordinates to table

Hi, I am in a bit of a hurry, I need to draw a table with point number, easting, northing, elevation for a lot of points and need a lisp to read the xl spreadsheet and draw the table, can you help.

Richie
9 REPLIES 9
Message 2 of 10

I have written the atached lisp but it is reporting an error can anyone fix it for me

Richie
Message 3 of 10
jggerth1
in reply to: richie_hodgson

post your sample text file please. 

Message 4 of 10

Here is the text file

Richie
Message 5 of 10
devitg
in reply to: richie_hodgson

Your firts error is the WCMATCH wilcard use

 

      (prompt (strcat "\n" LN))
;;;"0\t415013.38\t790131.48\t0" 

      
      (cond
        ((wcmatch LN "*`,*") (setq CD T)); CD = Comma Delimited
;;;;the COMMA char is a reserved wildcar , in this case it will return T , despite it have no comma 
 ;;;"0\t415013.38\t790131.48\t0"
 ;;To use COMMA as pattern it need a reversed quote `
       
        ((wcmatch LN "*`\t*") (setq CD nil)); space delimited
;;Your file is not space limited , it is TAB limited
;; browse the lisp help for wcmatch 
        
        
        (T (prompt "\nDid not recognize format.") (quit)); otherwise
      ); cond

 

Also you have a miss ) 

 

	(setq pt2 (list 0 0))
	(Setq pt3 (list 0 25));_ miss parenthesis
	(setq pt4 (list 150 25))

 

 

I  have to chek it further more , it is the start.

 

Feel fre to contact me , if you want to.

 

 

 

 

 

 

Message 6 of 10
devitg
in reply to: devitg

see more observation at the lisp , and see how the dwg it is do.

 

 

Message 7 of 10

Had a little time to look at my lisp and the attached works pretty well, a few tweeks to go but I am all good now. You may have the text rotated weirdly but it works fine for our 0 degrees orientation of North.

Richie
Message 8 of 10
devitg
in reply to: richie_hodgson

Ok

Message 9 of 10

One quick question though, if the data was code,x,y,z instead of chainage,x,y,z what do I need to do to make that work? I get really confused with mixing up text and real numbers.

Richie
Message 10 of 10
devitg
in reply to: richie_hodgson

To fill the table , you need TEXT , so you shall use (RTOS number  2 4)   2 for decimal , 4 for precision or 

 

From the VLIDE help 

 

 

Converts a number into a string

(rtos number [mode [precision]]) 
The rtos function returns a string that is the representation of number according to the settings of mode, precision, and the system variables UNITMODE, DIMZIN, LUNITS, and LUPREC. 

Arguments

number
A number.

mode
An integer specifying the linear units mode. The mode corresponds to the values allowed for the LUNITS AutoCAD system variable. The mode can be one of the following numbers:

1 Scientific

2 Decimal

3 Engineering (feet and decimal inches)

4 Architectural (feet and fractional inches)

5 Fractional

 

ITOA , integer to alfa 

 

itoa 
 
 
Returns the conversion of an integer into a string

(itoa int) 
Arguments

int
An integer.

Return Values

A string derived from int.

Examples

Command: (itoa 33)

"33" 

Command: (itoa -17)

"-17"

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost