TheSwamp

Code Red => VB(A) => Topic started by: ImaJayhawk on September 02, 2004, 10:52:19 AM

Title: WhoHas
Post by: ImaJayhawk on September 02, 2004, 10:52:19 AM
Is there a way to add some code to a template drawing that will check to see if the person opening the drawing has the WhoHas.arx loaded?  And if not attempt to load it?

Thanks.


--ImaJayhawk
Title: WhoHas
Post by: MP on September 02, 2004, 11:12:11 AM
Abbreviated -

Code: [Select]
(if
    (null
        (member
            (setq app "WHOHAS.ARX")
            (mapcar 'strcase (arx))
        )
    )
    (arxload app)
)

This assumes whohas.arx is a legitimate app in the support path. You may need to add add'l code to make this bullet proof.
Title: WhoHas
Post by: Keith™ on September 02, 2004, 11:51:02 AM
MP, that lisp must be loaded each time to make it effective and if you load it on every drawing, it does not meet the criteria to load when a certain template is used.

You can create a VBA application, and embed the macro in the drawing file using the VBA manager.
Title: WhoHas
Post by: MP on September 02, 2004, 11:56:39 AM
Note to self: have coffee before starting to post. I saw template, not template dwg, and assumed the poster just meant their startup lisp.

:)
Title: WhoHas
Post by: JohnK on September 02, 2004, 12:51:25 PM
No thats cool MP; You can use that code. Use a Persistant reactor. (Although i highly recomend you dont, but you could if you were brave.)
Title: WhoHas
Post by: Keith™ on September 02, 2004, 02:19:07 PM
eeewww that would not be a smart thing to do....
Title: WhoHas
Post by: ImaJayhawk on September 02, 2004, 04:39:18 PM
Looks like embedding is the way to go.  It's been a while since I've done any VB can someone give me a bump in the right direction for loading the arx.  Thanks.


--ImaJayhawk
Title: WhoHas
Post by: Keith™ on September 02, 2004, 06:46:23 PM
use this scenario:
Code: [Select]

ACADApplication.LoadArx("WhoHax.arx")
Title: WhoHas
Post by: ImaJayhawk on September 03, 2004, 09:23:39 AM
Thanks  


--ImaJayhawk :D