Sample Apps for AcadX ActiveX Extension

Sample Apps for AcadX ActiveX Extension

Anonymous
Not applicable
756 Views
11 Replies
Message 1 of 12

Sample Apps for AcadX ActiveX Extension

Anonymous
Not applicable
The AcadX page on my web site has been updated.

The Document Selector window from the FreeDock tools
collection is now available as a sample application
with complete source.

The sample application is available in both a VB5
version and the original Delphi 5 version that was
used to build the FreeDock tool. Both samples use
the AutoCAD Dockable Container from Jorge Lopez.

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.tanzillo@worldnet.att.net */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
0 Likes
757 Views
11 Replies
Replies (11)
Message 2 of 12

Anonymous
Not applicable
I like the functions provided by your app, but the alert dialog box is
annoying. Is it to much to ask to change it to a (prompt) instead?

Dan Elkins
0 Likes
Message 3 of 12

Anonymous
Not applicable
What alert dialog box is that?

Dan Elkins wrote:
>
> I like the functions provided by your app, but the alert dialog box is
> annoying. Is it to much to ask to change it to a (prompt) instead?
>
> Dan Elkins

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.tanzillo@worldnet.att.net */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
0 Likes
Message 4 of 12

Anonymous
Not applicable
I downloaded the latest build from your web site and when I load the
AcadX.arx file it pops up an alert dialog box. See attached file. It's a
small jpg so I hope no one minds that I attached it here.

Dan Elkins
0 Likes
Message 5 of 12

Anonymous
Not applicable
Yes - but this should not be a problem, because this only
appears when you load AcadX.arx as an ARX application, which
is normally not required.

Please read the documentation. You only need to load AcadX.arx
as an ARX program once, in order to register it as an ActiveX
server. After doing that, you should never load it as an ARX
program.

Dan Elkins wrote:
>
> I downloaded the latest build from your web site and when I load the
> AcadX.arx file it pops up an alert dialog box. See attached file. It's a
> small jpg so I hope no one minds that I attached it here.
>
> Dan Elkins
>
> [Image]

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.tanzillo@worldnet.att.net */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
0 Likes
Message 6 of 12

Anonymous
Not applicable
I did what your installation said:

Installation:
AcadX.arx must be registered by loading it into AutoCAD's process space.
(skip ahead). This step needs to be performed only once, and once completed
AcadX.arx will be properly registered as an ActiveX server. You can load
AcadX.ARX as an ARX application by dropping AcadX.arx on the AutoCAD window.
Alternately, you can load AcadX.arx using the ARX or APPLOAD commands, or by
using the (arxload) AutoLISP function, or the LoadARX() method of the
AutoCAD Application Object from VBA or an ActiveX client.

I loaded it by dragging and droping and by typing (arxload "AcadX.arx") and
the dialog box happens everytime I load it on a new session of AutoCAD.

Dan Elkins
0 Likes
Message 7 of 12

Anonymous
Not applicable
Dan Elkins wrote:
>
> I loaded it by dragging and droping and by typing (arxload "AcadX.arx") and
> the dialog box happens everytime I load it on a new session of AutoCAD.

Perhaps my instructions are not clear. They say that you
only have to load AcadX.arx as an ARX application _ONCE_
(here, "ONCE" means when you first install it, not every
time you start AutoCAD).

You do not have to, and should not ARXLOAD AcadX.arx at all
for normal use. It is automatically loaded when you use
GetInterfaceObject("Acadx.Application"), and in that case,
it does not display any dialog (just a command line message).

Do not attempt to load AcadX.arx as an ARX program. It will
be automatically loaded by Windows when you request an
instance of the Application or DocumentManager objects via
the GetInterfaceObject() method of the AutoCAD object.

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.tanzillo@worldnet.att.net */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
0 Likes
Message 8 of 12

Anonymous
Not applicable
Oh. I was just going to mess with some of the functions through lisp like
the ones you uploaded in the customerfiles newsgroup:
(defun SetProgressMeter (label min max)
(getAcadX)
(vlax-invoke-method
*acadx*
'SetProgressMeter
label min max
)
)

Thanks for making it a little clearer. I guess I should learn VB.

Dan Elkins
0 Likes
Message 9 of 12

Anonymous
Not applicable
You don't have to learn VB. It works the same regardless
of the language. If you use Visual LISP, AcadX will be
loaded automatically when you call vla-get-interfaceObject
to get the Application or DocumentManager objects.

You don't need to do an (arxload) first.

Dan Elkins wrote:
>
> Oh. I was just going to mess with some of the functions through lisp like
> the ones you uploaded in the customerfiles newsgroup:
> (defun SetProgressMeter (label min max)
> (getAcadX)
> (vlax-invoke-method
> *acadx*
> 'SetProgressMeter
> label min max
> )
> )
>
> Thanks for making it a little clearer. I guess I should learn VB.
>
> Dan Elkins

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.tanzillo@worldnet.att.net */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
0 Likes
Message 10 of 12

Anonymous
Not applicable
> You don't have to learn VB. It works the same regardless
> of the language. If you use Visual LISP, AcadX will be
> loaded automatically when you call vla-get-interfaceObject
> to get the Application or DocumentManager objects.

I just figured that out. Looks cool. Do you have LISP functions like the
one I put in the last message (SetProgressMeter) blocked out already. I
tried messing around with some of your functions and modified one to:

(defun GetBlockRefs (blkname comments)
(getAcadX)
(vlax-invoke-method
*acadx*
'GetBlockRefs
blkname comments
)
)

...but I guess it's harder than it looks.

Dan Elkins
0 Likes
Message 11 of 12

Anonymous
Not applicable
GetBlockRefs takes an AcadBlock object as its only
parameter, not the name of a block, which appears
to be what you're passing it. I also am not sure
what the "comments" argument is for. Please read
the documentation and you'll see that GetBlockRefs
takes only a single parameter, which is the block
object whose insertions are to be reterned.

This will return them in a list:

(defun ListBlockRefs (blockname)
(setq *acad* (vlax-get-acad-object))
(GetAcadX)
(setq block
(vla-item
(vla-get-blocks
(vla-get-activedocument *acad*)
)
blockname
)
)
(vlax-safearray->list
(vlax-variant-value
(vlax-invoke-method
*acadx*
'GetBlockRefs
block
)
)
)
)

Dan Elkins wrote:
>
> > You don't have to learn VB. It works the same regardless
> > of the language. If you use Visual LISP, AcadX will be
> > loaded automatically when you call vla-get-interfaceObject
> > to get the Application or DocumentManager objects.
>
> I just figured that out. Looks cool. Do you have LISP functions like the
> one I put in the last message (SetProgressMeter) blocked out already. I
> tried messing around with some of your functions and modified one to:
>
> (defun GetBlockRefs (blkname comments)
> (getAcadX)
> (vlax-invoke-method
> *acadx*
> 'GetBlockRefs
> blkname comments
> )
> )
>
> ...but I guess it's harder than it looks.
>
> Dan Elkins

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.tanzillo@worldnet.att.net */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
0 Likes
Message 12 of 12

Anonymous
Not applicable
Sorry,

I meant SetBlockComments. I read the documentation but as a novice some of
it is a little fuzzy. If I have any more questions, I'll probably post it
in the customization group. Thanks for the help.

Dan
0 Likes