TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Andrea on September 29, 2009, 03:40:06 PM

Title: Mlisp vs Field ??
Post by: Andrea on September 29, 2009, 03:40:06 PM
Hi all..

I'm thinking about a new concept to use MTEXT with Lisp.

I know that Filed is cool...but I think that it is limited...
We can use many thing like AutoCAD and Lisp Variables...

but is it anought ?

There is the first scratch of :

Mlisp v.1.0.0  

(conceptual design at the moment to know your feilling pulse)

the first Gif show a simple code..
but you can do anything !!  even put an
Code: [Select]
(alert "Hello!") or (startapp ...)..thanks.


Title: Re: Mlisp vs Field ??
Post by: Lee Mac on September 29, 2009, 03:46:48 PM
Nice idea Andrea - Am I right in saying that you are just detecting the use of parentheses within the Mtext String? Or have you come up with something more ingenious? (probably the latter :wink:)

I suppose perhaps reactors would be used to update text that contains these LISP expressions - nice idea I must say.  :kewl:

Lee
Title: Re: Mlisp vs Field ??
Post by: Andrea on September 29, 2009, 03:54:55 PM
thanks Lee.

Is that Idea was on of your program list ??  LOL !! :wink:

for the moment....I do not use any reactor.
but the power of it it is that you can run any lisp function ..

 ^-^

Title: Re: Mlisp vs Field ??
Post by: T.Willey on September 29, 2009, 04:15:27 PM
Could be cool, but I wouldn't want to use/support it in a production environment, especially when you share drawings with other firms.
Title: Re: Mlisp vs Field ??
Post by: Lee Mac on September 29, 2009, 04:29:42 PM
thanks Lee.

Is that Idea was on of your program list ??  LOL !! :wink:

for the moment....I do not use any reactor.
but the power of it it is that you can run any lisp function ..


I must admit, I hadn't thought of that - but maybe in the future, I might've...  :-P

I think you would need to implement reactors of some sort, to update the display.  :-)

Could be cool, but I wouldn't want to use/support it in a production environment, especially when you share drawings with other firms.

True, I agree - the firms would not know what to do with the text without having the function supplied, and I would think it may cause more trouble than its worth...  :oops:
Title: Re: Mlisp vs Field ??
Post by: Lee Mac on September 29, 2009, 05:34:27 PM
PS> Andrea, why do your screen animations always seem to have a "faded" look about them? I assume you are using Camtasia right?
Title: Re: Mlisp vs Field ??
Post by: Andrea on September 29, 2009, 05:36:19 PM
I 've played with background color...

 :-)
Title: Re: Mlisp vs Field ??
Post by: Lee Mac on September 29, 2009, 05:47:01 PM
I 've played with background color...

 :-)

Oh right, I just prefer the jet black background - makes it clearer imo  :wink:
Title: Re: Mlisp vs Field ??
Post by: Andrea on September 30, 2009, 08:04:31 AM
Could be cool, but I wouldn't want to use/support it in a production environment, especially when you share drawings with other firms.

Thanks Tim...maybe you'r right, same thing with fields,
but I think that can be more useful than fields for many firms.
Title: Re: Mlisp vs Field ??
Post by: CHulse on September 30, 2009, 09:10:17 AM
Excellent idea! I have been looking for a way to use lisp in fields - this seems like the solution.  8-)
Very cool indeed.
Title: Re: Mlisp vs Field ??
Post by: SPDCad on September 30, 2009, 09:56:17 PM
When fields came out back in release 2005 (i believe it was), it was my first wish list item for AutoCAD 2006. To have the power of lisp in the field command.
Sadly Audotdesk still haven't listened, but thanks to Andrea I may just have that power...(with an evil laugh)

I use DIESIL in the field command whenever i can, but only for small things. The power of lisp is just not there.
At one time i used to use DIESEL with the rtext command.  I believe it was in release 2002 and 2004.

Oh how i wish i had the time and knowledge to prosue great ideas like Andrea and Lee mac have.
I am totally jealeous of you guys and gals.
I am excited and can't wait to explore the code for this lisp.

Keep up the great work!!!




Title: Re: Mlisp vs Field ??
Post by: Crank on October 01, 2009, 07:03:02 AM
When fields came out back in release 2005 (i believe it was), it was my first wish list item for AutoCAD 2006. To have the power of lisp in the field command.
Sadly Audotdesk still haven't listened,[...]
This was not in Acad2006, but now you can add LispVariables, SystemVariables and Formulas in FIELDs.
Title: Re: Mlisp vs Field ??
Post by: Andrea on October 01, 2009, 08:59:13 AM
When fields came out back in release 2005 (i believe it was), it was my first wish list item for AutoCAD 2006. To have the power of lisp in the field command.
Sadly Audotdesk still haven't listened,[...]
This was not in Acad2006, but now you can add LispVariables, SystemVariables and Formulas in FIELDs.

Mlisp allow Lisp function not only lisp variables. :pissed:
Title: Re: Mlisp vs Field ??
Post by: Crank on October 01, 2009, 12:11:28 PM
Mlisp allow Lisp function not only lisp variables. :pissed:
OK, but all your examples are also possible with fields. The idea is interesting, but I'm not convinced. ;)
Title: Re: Mlisp vs Field ??
Post by: alanjt on October 01, 2009, 12:42:41 PM
Code: [Select]
(length (layoutlist))
Title: Re: Mlisp vs Field ??
Post by: Lee Mac on October 01, 2009, 12:52:40 PM
Code: [Select]
(length (layoutlist))

haha good example  :wink:
Title: Re: Mlisp vs Field ??
Post by: Andrea on October 01, 2009, 01:10:02 PM
another one ??   :evil:
Title: Re: Mlisp vs Field ??
Post by: alanjt on October 01, 2009, 01:14:46 PM
Code: [Select]
(length (layoutlist))

haha good example  :wink:
:) Thought you'd like that.
Title: Re: Mlisp vs Field ??
Post by: Lee Mac on October 01, 2009, 01:15:36 PM
Nice idea Andrea  - good example.
Title: Re: Mlisp vs Field ??
Post by: alanjt on October 01, 2009, 01:19:31 PM
This has monstrous potential, I just wish it was core.
Title: Re: Mlisp vs Field ??
Post by: Crank on October 01, 2009, 01:21:22 PM
Good examples!
As soon as everybody at our company knows a bit of lisp IŽll put it in the menu.   :-P
Title: Re: Mlisp vs Field ??
Post by: Lee Mac on October 01, 2009, 01:25:46 PM
I wonder... could you incorporate this functionality into the Text of the "famous" DiLeader...   :-P  ;-)
Title: Re: Mlisp vs Field ??
Post by: Andrea on October 01, 2009, 01:31:57 PM
all it is now possible...

even hide the code.
Title: Re: Mlisp vs Field ??
Post by: Lee Mac on October 01, 2009, 01:34:57 PM
I'm loving the use of MTJIGSTRING in all this  :-P

Andrea, just curious, would the code work if I were to have a textstring something like this:

Code: [Select]
"Hello Andrea (Andreetti) would this work? (princ "\nNice Program")"
Title: Re: Mlisp vs Field ??
Post by: Andrea on October 01, 2009, 01:45:59 PM
I'm loving the use of MTJIGSTRING in all this  :-P

Andrea, just curious, would the code work if I were to have a textstring something like this:

Code: [Select]
"Hello Andrea (Andreetti) would this work? (princ "\nNice Program")"

Until the program is not ready....I got no error but wrong result..
let me take some days and i'll be back with the first attempt code.   8-)
If you have some other string that I can test please let me know.
thanks.
Title: Re: Mlisp vs Field ??
Post by: alanjt on October 01, 2009, 01:49:44 PM
I'm loving the use of MTJIGSTRING in all this  :-P

Andrea, just curious, would the code work if I were to have a textstring something like this:

Code: [Select]
"Hello Andrea (Andreetti) would this work? (princ "\nNice Program")"

Until the program is not ready....I got no error but wrong result..
let me take some days and i'll be back with the first attempt code.   8-)
If you have some other string that I can test please let me know.
thanks.

Yeah, it's going to need some kind of validation, similar to the Diesel one in Fields.
Title: Re: Mlisp vs Field ??
Post by: Lee Mac on October 01, 2009, 04:02:03 PM
I'm loving the use of MTJIGSTRING in all this  :-P

Andrea, just curious, would the code work if I were to have a textstring something like this:

Code: [Select]
"Hello Andrea (Andreetti) would this work? (princ "\nNice Program")"

Until the program is not ready....I got no error but wrong result..
let me take some days and i'll be back with the first attempt code.   8-)
If you have some other string that I can test please let me know.
thanks.

I just wondered about the method of LISP code validation, as Alanjt points out.  :wink:
Title: Re: Mlisp vs Field ??
Post by: CHulse on October 02, 2009, 09:25:23 AM
Code: [Select]
(length (layoutlist))

haha good example  :wink:
:) Thought you'd like that.


Ha Ha, where have I seen that one before?  :wink:


I can't wait to try this...  8-)
Title: Re: Mlisp vs Field ??
Post by: alanjt on October 02, 2009, 02:37:21 PM
Code: [Select]
(length (layoutlist))

haha good example  :wink:
:) Thought you'd like that.

Ha Ha, where have I seen that one before?  :wink:


I can't wait to try this...  8-)

Did you see my solution. ;)
Title: Re: Mlisp vs Field ??
Post by: Andrea on October 02, 2009, 03:00:19 PM
Well....after some test..I have realized that program will be more handy that i've thougth.
For the moment, there is no reactor on it...(making some tests)
but I've created MLISP & MLISPEDIT command..
i'l try to be back next week with the code.
Have a nice weekend all. !   :laugh:



Title: Re: Mlisp vs Field ??
Post by: CHulse on October 03, 2009, 10:56:01 AM
Code: [Select]
(length (layoutlist))

haha good example  :wink:
:) Thought you'd like that.



Ha Ha, where have I seen that one before?  :wink:


I can't wait to try this...  8-)

Did you see my solution. ;)


No, I hadn't. ...running to look now....

Title: Re: Mlisp vs Field ??
Post by: Andrea on October 05, 2009, 06:32:10 PM
ok...

there it is...

MLISP v.1.0
this is my first draft...

command: MLISP  <- create a MTEXT allowing LISP.
command: MLISPEDIT  <- edit MTEXT who have LISP inside.

by pressing ShiftKey...you can see the code inside without editing the MTEXT. :kewl:

need tester..

thanks.  :-)
Title: Re: Mlisp vs Field ??
Post by: SteveK on October 05, 2009, 07:05:40 PM
Been waiting all week for this  :-) Pretty neat, thanks Andrea.
Title: Re: Mlisp vs Field ??
Post by: Aerdvark on October 06, 2009, 02:02:14 AM
Hi Andrea,

Funny to say, maybe even a little  :ugly: but I can not think of any use for this program.
It looks cool and I wonder how to apply it any time.

I'm following this threat so I am on it...
Title: Re: Mlisp vs Field ??
Post by: Andrea on October 06, 2009, 08:31:14 AM
no problem guys...

I'm just sharing the code to free my head a little bit.. :laugh:
Title: Re: Mlisp vs Field ??
Post by: Sebb77 on October 06, 2009, 10:02:47 AM
 :angel:  Really really nice Andrea.
Idea:  your program will be really useful to me, in order to code what shall be an "Auto-Updating Legend" , which i've been thinking about for a couple months.
I'll inform you on the development later down the road. Thanks!

keep lispin'
Title: Re: Mlisp vs Field ??
Post by: SteveK on October 06, 2009, 10:09:30 PM
Funny to say, maybe even a little  :ugly: but I can not think of any use for this program.
It looks cool and I wonder how to apply it any time.
I just think it is a clever tool, somethin different. And I'll be able to learn things from the code.

If I was to use it in projects it would need a function to update all mlisps instead of having to edit each one individually.
And having it for attributes would be very handy, but not sure if that's doable...
Title: Re: Mlisp vs Field ??
Post by: Andrea on October 07, 2009, 09:20:59 AM
Funny to say, maybe even a little  :ugly: but I can not think of any use for this program.
It looks cool and I wonder how to apply it any time.
I just think it is a clever tool, somethin different. And I'll be able to learn things from the code.

If I was to use it in projects it would need a function to update all mlisps instead of having to edit each one individually.
And having it for attributes would be very handy, but not sure if that's doable...

Allready done..in test at the moment.. :roll:
Title: Re: Mlisp vs Field ??
Post by: alanjt on October 07, 2009, 12:27:30 PM
Funny to say, maybe even a little  :ugly: but I can not think of any use for this program.
It looks cool and I wonder how to apply it any time.
I just think it is a clever tool, somethin different. And I'll be able to learn things from the code.

If I was to use it in projects it would need a function to update all mlisps instead of having to edit each one individually.
And having it for attributes would be very handy, but not sure if that's doable...

Allready done..in test at the moment.. :roll:


Now we're talking. :)
Title: Re: Mlisp vs Field ??
Post by: Andrea on October 07, 2009, 02:00:26 PM
update 1

MLISP v.1.1

New Function:

MLISPUPDATE  <- allow to update existing MLISP entity

Command: mlispupdate
(S)elect Entity or (*) for All <*>: S
Select MTEXT entity...

or * to select all

Enjoy !
Title: Re: Mlisp vs Field ??
Post by: SteveK on October 07, 2009, 05:30:27 PM
Great, thanks  :-)
Title: Re: Mlisp vs Field ??
Post by: mkweaver on October 08, 2009, 12:13:24 AM
Now that is cool!

I'm going to have to spend some time with this.

Thanks for sharing.
Title: Re: Mlisp vs Field ??
Post by: Aerdvark on October 08, 2009, 01:58:13 AM
No very often I felt so  :? for I really can't think of the use... I know, due to my lack of knowledge... :oops:

What you are trying to say with the last gif, is that a drawing list that can be updated if one of the titleblocks is modified?
ie.: the dwg itself contains 5 identical title blocks with 5 identical attribute tags.
The attribute values differ of course.

Can you put these values (like E001 E002 etc) in the mlisp?
If so, then YES I and many others will have great use for it!
Creating drawing list!

If you'd need a tester for that, I'm here!
Title: Re: Mlisp vs Field ??
Post by: Andrea on October 08, 2009, 01:05:40 PM
No very often I felt so  :? for I really can't think of the use... I know, due to my lack of knowledge... :oops:

What you are trying to say with the last gif, is that a drawing list that can be updated if one of the titleblocks is modified?
ie.: the dwg itself contains 5 identical title blocks with 5 identical attribute tags.
The attribute values differ of course.
Absolutely...you can do what LISP can make.
In ObjectDBX you can retreive theses Values..
But for the Gif Exemble...I only take the DWG list drawing name in the curent folder.

Can you put these values (like E001 E002 etc) in the mlisp?
YES !

If so, then YES I and many others will have great use for it!
Creating drawing list!

If you'd need a tester for that, I'm here!

Thanks...
If you have any experimental problem...please let me know.

Enjoy !