TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: mcn on July 25, 2008, 07:42:57 AM

Title: Change A script
Post by: mcn on July 25, 2008, 07:42:57 AM
I have the following program which was created by a friend of mine. The program works very fine, but i want to add some extra features. My friend doesn't have time to do it, so I hope you will help me to do what I want.
I need to insert data from Excel sheets not from .dat files. These is first thing and to do some small customization of the script to add some percentage (%) character for the slope. and to trim the above manhole after the line on the top.

I don't know how to do it, that way I ask you.

Best Regards.
Marius
Title: Re: Change A script
Post by: DEVITG on July 25, 2008, 02:53:23 PM
Did you ask it to the author ??

Please keep the LOG updated and let me know of major changes at:
               ; netaqua@gmail.com


Title: Re: Change A script
Post by: CAB on July 25, 2008, 04:45:55 PM
Marius, welcome to the swamp.

Note that reading Excel files is full of little catches that could give you problems.
That being said there are lots of examples of Excel file reading. It is easier to read CSV files
or comma delimited files. Looking at your data file, the data is positionally sensitive.
To me that is the least desirable way to develop a data file.

Will the lisp work on any CAD system as it is?
Do you have a Excel data file for testing?

How much LISP programing can you do?


PS
I see you registered in November of 2007 and just now posting for the first time.
Title: Re: Change A script
Post by: mcn on July 28, 2008, 08:22:50 AM
Yes, I've asked the author, which is my friend.

The second one I have an excel sheet and is working, I translate from excel to .dat file.
I will attach the excel sheet and also i don't know any thing about lisp programing, sorry.

thanks.
Title: Re: Change A script
Post by: DEVITG on July 28, 2008, 02:05:26 PM
so you will work , at least , from the .dat file .

Using LISP , is better to work wit CSV file , also you can get it from the xls , by SAVING AS

It will better if you can upload a DWG sample of what this lisp can do , or wghat do you want to be done.

Title: Re: Change A script
Post by: CAB on September 16, 2008, 07:54:47 AM
DEVITG,
Are you the author?
I just opened the lisp in the zip file & found this header:
Quote
; PLEASE DO NOT REMOVE THE FOLLOWING LINES
;;; -------------------------------------- ;;;
;;; Trasare profil longitudinal CANALIZARE ;;;
;;; Ver. 1.1                    25.04.2005 ;;;
;;; -------------------------------------- ;;;
;;;                            NETAQUA srl ;;;
;;;                      Water Engineering ;;;
;;; _______________________________________;;;
Title: Re: Change A script
Post by: DEVITG on September 16, 2008, 08:27:49 AM
DEVITG,
Are you the author?
I just opened the lisp in the zip file & found this header:
Quote
; PLEASE DO NOT REMOVE THE FOLLOWING LINES
;;; -------------------------------------- ;;;
;;; Trasare profil longitudinal CANALIZARE ;;;
;;; Ver. 1.1                    25.04.2005 ;;;
;;; -------------------------------------- ;;;
;;;                            NETAQUA srl ;;;
;;;                      Water Engineering ;;;
;;; _______________________________________;;;


Hi Cab , no I am not the author .
If you see my first post I put this warning about to ask the author .



Quote
Did you ask it to the author ??

Please keep the LOG updated and let me know of major changes at:
               ; netaqua@gmail.com

And he say it is a friend of him.

Quote
Yes, I've asked the author, which is my friend.

Title: Re: Change A script
Post by: CAB on September 16, 2008, 08:41:50 AM
Thanks, just wanted to be clear.
 :-)
Title: Re: Change A script
Post by: DEVITG on September 16, 2008, 10:36:44 AM
OK

Clear counts , keep friendship.

Title: Re: Change A script
Post by: mcn on September 18, 2008, 04:02:55 AM
I attached the example of this lisp, what can do.

b.r. marius
Title: Re: Change A script
Post by: CAB on September 18, 2008, 08:13:19 AM
I'm not sure because I could not translate the comments but try changing this code:
Code: [Select]
      (command "text"
       "J"
       "MC"
       (list (+ 1.5 xpar) (- datum 58.0))
       "2.0"
       (- (atof (angtos (atan (/ 13.0 diparr)))))
       panta
      )
     
To this code: 
Code: [Select]
      (command "text"
       "J"
       "MC"
       (list (+ 1.5 xpar) (- datum 58.0))
       "2.0"
       (- (atof (angtos (atan (/ 13.0 diparr)))))
       (strcat panta " %") ; <-----<<  Change this
      )
   
Title: Re: Change A script
Post by: mcn on September 18, 2008, 09:02:38 AM
thanks, works fine, could you help me with another thing. I attached to the file with how is look, but i need another row between invert level and partial length with the following name and equation: Manual digging, invert level-10cm.


best regrds,
marius
Title: Re: Change A script
Post by: CAB on September 18, 2008, 07:44:16 PM
If I have some time this weekend but I would need the profil2.DAT file for testing the routine.

I am having problems translating some words from Romanian to English but I think I can overcome that problem.
Title: Re: Change A script
Post by: CAB on September 18, 2008, 07:53:17 PM
Words I can not translate are
Trasare
traseaza
oriz
cartus

Title: Re: Change A script
Post by: mcn on September 19, 2008, 02:20:51 AM
Trasare=lining or laying a line
traseaza=create a line from 1 point to another
oriz=horizontal
cartus= it think is the table under the profile, with all the in formations
Title: Re: Change A script
Post by: CAB on September 19, 2008, 08:06:27 AM
Thanks for the translations.
I'll get back to you.
Title: Re: Change A script
Post by: CAB on September 22, 2008, 10:37:26 AM
This is what I have so far.
Is the Manual Digging the correct number? [83.80]
Invert Level is 93.80
Title: Re: Change A script
Post by: mcn on September 22, 2008, 10:57:25 AM
hey,
you decrease with 10m, but you have to do with 10cm.

in rest is OK

best regards,
marius
Title: Re: Change A script
Post by: CAB on September 22, 2008, 11:06:40 AM
So the number should be 93.70?

I work in base 12 units so I'm not sure with your units.
Title: Re: Change A script
Post by: mcn on September 23, 2008, 02:18:02 AM
yes is correct

i use metric unit in millimeters usually
Title: Re: Change A script
Post by: CAB on September 23, 2008, 02:54:45 PM
Give this a try.
I did a major conversation away from the use of commands.

Only had the one data file so there may be some options that I did not test.