TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: MP on May 15, 2005, 11:58:10 AM

Title: ActiveX Help for LISPin' folks ...
Post by: MP on May 15, 2005, 11:58:10 AM
Responding to a challenge in this (http://www.theswamp.org/phpBB2/viewtopic.php?t=5176) thread (thanks Chuck!) I wrote AxProps (http://www.theswamp.org/lilly_pond/mp/lisp/axprops.fas?nossi=1) (use your logon name / password to download), a little utility that provides a simple gui interface to display all the properties and methods exposed to AutoLISP (via vla-*, vlax-get/put/invoke etc.) for a specified entity or object --

(http://www.theswamp.org/screens/mp/axprops01.png)

Double clicking an entry in the dialog will invoke the help system and display the appropriate help (if a topic for that item exists) --

(http://www.theswamp.org/screens/mp/axprops02.png)

(http://www.theswamp.org/screens/mp/coordshelp.png)

Finally, when there is a difference in the result returned by vlax-get and vlax-get-property (the former generally returning data types native to AutoLISP, the latter data types native to ActiveX), it shows both results separate by a " | " (pipe) symbol --

(http://www.theswamp.org/screens/mp/axprops03.png)

Download --

AxProps.fas (http://www.theswamp.org/lilly_pond/mp/lisp/axprops.fas?nossi=1) (use your logon name / password).

Command / Functions --

c:AxProps -- prompts you to to select an entity.
c:NAxProps -- prompts you to to select a nested entity.
AxProps, syntax: (AxProps x), where x is any valid object, ename or handle.

Feel crazy? Try this (axprops "1"). :lol:

I plan to add the ability to dump the whole mess to notepad so you can use the info in other ways, print off etc. Other ideas welcome, will try to incorporate ideas keeping with it's simple philosophy and lightweight footprint when I've the time.

Final note: I wrote this quick under Windows XP Pro and vanilla AutoCAD 2006. When this crashes on your system please provide the noted information, you'll be helping me out a lot. Thanks.

Enjoy.

:cheesy:
Title: ActiveX Help for LISPin' folks ...
Post by: Mark on May 15, 2005, 12:20:39 PM
Can't wait till Monday morning so I can try it out. Look's mighty nice there MP.
Title: ActiveX Help for LISPin' folks ...
Post by: MP on May 15, 2005, 12:27:56 PM
Thank you Mr. Thomas.

:)
Title: ActiveX Help for LISPin' folks ...
Post by: nivuahc on May 15, 2005, 12:57:33 PM
Kudos to you Mr. Puckett!

This will be a tremendous help to me, and many others.

:dood:
Title: ActiveX Help for LISPin' folks ...
Post by: MP on May 15, 2005, 01:01:20 PM
My pleasure Chuck, thank you for the idea.

(http://www.theswamp.org/screens/mp/thumbsup.gif)
Title: ActiveX Help for LISPin' folks ...
Post by: nivuahc on May 15, 2005, 01:09:41 PM
Question for you... what are your terms of distribution on this gem? Am I free to share it with whomever I like? I honestly believe that something like this would make great shareware and that there are many people who would be willing to pay a small fee to use it (myself included). I think I know what your response to that will be but, for the benefit of others, would you care to elaborate a little?
Title: ActiveX Help for LISPin' folks ...
Post by: MP on May 15, 2005, 03:43:15 PM
I desire no fee; freeware for everyone. You may distribute as you please so long as there is no fee involved, that is: you may not charge anyone for its use or distribution, nor may you include it in distributions that are fee based. Despite trivial coding it's copyrighted (as noted on loading and invocation); you may not modify, reverse engineer or decompile it.

Clear as mud?

:)
Title: ActiveX Help for LISPin' folks ...
Post by: CAB on May 15, 2005, 04:43:13 PM
Awesome routine you have there Michael. :shock:

Using ACAD2000 windows 2000
Code: [Select]
Command: _appload axprops.fas successfully loaded.


Command: AxPROPS.FAS 1.0 ( 2005 Michael Puckett).
Function: (AxProps x), where x is a valid ename, object or handle.
Commands: AxPROPS/nAxPROPS. Prompt (entsel/nentsel) for primary/nested entity.
Command:
Command: (axprops "1")
; error: bad argument type: stringp nil

Command: C:axprops
Unknown command "C:AXPROPS".  Press F1 for help.

Command: axprops

Select object: ; error: bad argument type: stringp nil

Command:


The initial dialog box comes up, but
When double clicking on an item, like Layer
I get the error. Select object: ; error: bad argument type: stringp nil
Title: ActiveX Help for LISPin' folks ...
Post by: Kerry on May 15, 2005, 05:14:56 PM
Command: (axprops "1")
Command: (axprops "2")
Command: (axprops "3")

Do what "I think" they are s'posed to.

Thanks again Michael for sharing.
Title: ActiveX Help for LISPin' folks ...
Post by: MP on May 15, 2005, 05:19:41 PM
Hi Alan, what does this

(setq helpfile (findfile "acadauto.chm"))

return on your system?
Title: ActiveX Help for LISPin' folks ...
Post by: MP on May 15, 2005, 05:22:47 PM
My pleasure Kerry.

:)
Title: ActiveX Help for LISPin' folks ...
Post by: CAB on May 15, 2005, 05:27:01 PM
(setq helpfile (findfile "acadauto.chm"))
nil

I have acadauto.hlp with ACAD2000
no chm except for acet.chm
Title: ActiveX Help for LISPin' folks ...
Post by: MP on May 15, 2005, 05:32:05 PM
Exactly what I thought, that what's making this utility toss a wobbly, it's designed to work on systems with the chm style help. Hmmm, can you send me your help file? I'll see what I can do.
Title: ActiveX Help for LISPin' folks ...
Post by: MP on May 15, 2005, 05:44:01 PM
Until I code alternately using AcadAuto.hlp (wild assumption that I can) I've recoded the program to deal with the failure to locate AcadAuto.chm more elegantly. I've uploaded the new version (read: "please download new version").

AxProps.fas (http://www.theswamp.org/lilly_pond/mp/lisp/axprops.fas?nossi=1) (use your logon name / password).

Gotta head out in about 5 minutes, but I'll be back later tonight.
Title: ActiveX Help for LISPin' folks ...
Post by: nivuahc on May 15, 2005, 06:17:17 PM
Quote from: MP
I desire no fee; freeware for everyone. You may distribute as you please so long as there is no fee involved, that is: you may not charge anyone for its use or distribution, nor may you include it in distributions that are fee based. Despite trivial coding it's copyrighted (as noted on loading and invocation); you may not modify, reverse engineer or decompile it.

Clear as mud?

:)


Just about exactly what I thought you would say. :keb:

You know, I'm completely amazed by this tool you've written. It's one of those things that, once you see and use it, you wonder why the folks at Autodesk never thought of including something exactly like it in AutoCAD in the first place. Am I the only one who feels that way? :|  

What a time/confusion/headache saver! :D
Title: ActiveX Help for LISPin' folks ...
Post by: nivuahc on May 15, 2005, 06:19:12 PM
I'm reminded of those commercials for Guinness beer...

Quote from: Guinness Beer Guy
Brilliant!
Title: ActiveX Help for LISPin' folks ...
Post by: nivuahc on May 16, 2005, 08:20:46 AM
Just tested it on Vanilla 2002 and it works perfectly!

:)

Thanks again Michael!
Title: ActiveX Help for LISPin' folks ...
Post by: Crank on May 16, 2005, 09:33:09 AM
Thanks Michael(http://www.xs4all.nl/~crack/smilies/tovenaar.gif), this makes life a lot easier!(http://www.xs4all.nl/~crack/smilies/cheer.gif)

2 questions:
Title: ActiveX Help for LISPin' folks ...
Post by: MP on May 16, 2005, 10:27:01 AM
Quote from: Crank
Thanks Michael(http://www.xs4all.nl/~crack/smilies/tovenaar.gif), this makes life a lot easier!(http://www.xs4all.nl/~crack/smilies/cheer.gif)

My pleasure, hope it helps you along your journey. :)

Quote from: Crank
Can you add getkword to choose between AxPROPS and nAxPROPS?

I'd rather not, but then again, maybe you're not the only one who wants this. Is it the naming that bugs you, like would you prefer AxPropsX for the nested version? Notwithstanding, there's nothing stopping you from calling (AxProps x) anyway you want via your own wrapper, including exactly as you described.

Quote from: Crank
If there is already a helpscreen in the background, is it possible then to use that window?

I could, but <guessing> it would not immediately receive focus. Also, I thought folks might want to have independent windows for subsequent help screens.

You guys indicate what you want, I'll try to respond to the majority.

:)
Title: ActiveX Help for LISPin' folks ...
Post by: MP on May 16, 2005, 11:50:39 AM
Please note that I found a bug in the program this morning. It crashes on PolyLines. The fix is easy, but I don't have the source code here, so I'll fix it up when I get home tonight.

Also, regarding Crank's request consider this quick one off:

Code: [Select]
(defun c:Propsx ( / mia getkey key lst )

    (cond
   
        (   (and
                (setq mia (null AxProps))
                (null (findfile "axprops.fas"))
            )
            (princ "Cannot find axprops.fas, aborting.")
        )    
       
        (   (and
                mia
                (eq 'failed (load "axprops.fas"))
            )
            (princ "Cannot load axprops.fas, aborting.")
        )
       
        (   (defun GetKey ( / result )
                (while
                    (null
                        (eq 2
                            (car
                                (setq result (grread))
                            )
                        )
                    )
                )
                (cadr result)
            )

            (setq lst
                (mapcar 'ascii
                   '("p" "P" "n" "N" "\r" " ")
                )
            )
           
            (if mia (princ "\n\n"))

            (princ
                (strcat
                    "Press [p] or [enter] to select a "
                    "primary entity, [n] for a nested one: "
                )    
            )

            (while
                (null
                    (member
                        (setq key (GetKey))
                        lst
                    )
                )    
            )

            (setq ename
                (car
                    (if (member key (mapcar 'ascii '("n" "N")))
                        (nentsel)
                        (entsel)
                    )
                )
            )
           
            (vl-load-com)

            (AxProps ename)
        )
    )    

    (princ)
   
)


:)
Title: ActiveX Help for LISPin' folks ...
Post by: MP on May 16, 2005, 09:23:52 PM
Bug squished, please download latest version.

AxProps.fas (http://www.theswamp.org/lilly_pond/mp/lisp/axprops.fas?nossi=1) (use your logon name / password).

Altered presentation of data slightly, I'll let you find the change.

:)
Title: Re: ActiveX Help for LISPin' folks ...
Post by: DEVITG on December 25, 2005, 09:19:56 AM
Hi Michael , just one of the best gift on my chrismas tree.
Thanks
Title: Re: ActiveX Help for LISPin' folks ...
Post by: MP on December 26, 2005, 01:55:12 AM
Waaaaat the ... well, thanks DEVITG, right nice of you to say so ... thanks!

:)
Title: Re: ActiveX Help for LISPin' folks ...
Post by: GDF on December 26, 2005, 08:54:02 AM
Thanks

Thank you Michael. I like it as much as you ATOMS.vlx routine. I think the people at Autodesk would make use of this.

Gary
Title: Re: ActiveX Help for LISPin' folks ...
Post by: MP on December 26, 2005, 10:35:25 AM
Thanks Gary! lol, it seems like a lifetime ago when I wrote atoms, I kinda forgot about it.

:lol:
Title: Re: ActiveX Help for LISPin' folks ...
Post by: Joe Burke on December 30, 2005, 05:14:57 AM
Very nice, Michael. Thank you.   :-)

A couple cosmetic questions. Could the window be resizable? Likewise, recall its last location and size?

On my two monitor setup the window always appears centered on the drawing window monitor, regardless of where it was when last closed. I'd prefer to have it on the other monitor so it doesn't obscure the drawing.

Forgive me if this is nit-picking.
Title: Re: ActiveX Help for LISPin' folks ...
Post by: JAY on June 05, 2015, 12:06:35 AM
Thanks for sharing .
where is the Atoms.vlx ?

Title: Re: ActiveX Help for LISPin' folks ...
Post by: Kerry on June 05, 2015, 11:13:21 PM
Thanks for sharing .
where is the Atoms.vlx ?

Here 'tis http://www.theswamp.org/index.php?topic=8163.msg104698#msg104698
Thanks to Michael.
Title: Re: ActiveX Help for LISPin' folks ...
Post by: JAY on June 05, 2015, 11:24:53 PM
Thanks for sharing .
where is the Atoms.vlx ?

Here 'tis http://www.theswamp.org/index.php?topic=8163.msg104698#msg104698
Thanks to Michael.

Thanks Kerry.