Synchronous processing using the SendCommand

Synchronous processing using the SendCommand

Anonymous
Not applicable
320 Views
3 Replies
Message 1 of 4

Synchronous processing using the SendCommand

Anonymous
Not applicable
I am going crazy trying to determine an event to produce synchronous
flow of the SendCommad method using Acad 2002. I am trying to put
together a program to insert our title block based on units and scale.
I have a user form ask for information regarding units and scale then
build a SendCommand Lisp argument based on the user input and then
execute the SendCommand method .

A little background. We only use one size of paper and actually we have
multiple title blocks in a single drawing file. This allows us to
update all information in one file, due to SDI through R14. We have
used templates DWT in the past and have 17 different DWT files based on
units and scale. I have the job of maintaining these files and would
rather not have to try to maintain 17 files. I want to use a DWG and
insert it as a block to scale and set the dimscale and textsize system
variables accordingly.

So after the user responds to the user form the title block is brought
in via the "ghost" image allowing the user to place the title block
exactly were they would like it, hence the reason to use SendCommand
instead of Insert method. Now the problem enters as I want to explode
the title block so the attribute information can be updated and allow
the system variables to be set. The problem is I have not found an
event I can use to sense the command is synchronously complete because I
am using a Lisp expression in my SendCommand method. All other code
runs in the procedure before the block is placed into the file. So the
find and explode procedure I call runs before it can find the block is
in the drawing.

I have tried using the LispEnd event of the document object but a call
to the find and explode procedure happens before the block is placed
because the Lisp routine has completed before the block is placed into
the file. The same problem occurs if I call the procedure after the
SendCommand method.

I have looked at the AcadX.arx written by Tony Tanzillo. I have not
fully digested all that can do as well as he makes the disclaimer not to
include use of the object in high end production processes as the
software is untested.

If anyone has work around a similar problem I would appreciate the
details of how you accomplished it. If anyone is doing a similar title
block task I would be interested in the details, if you are willing to
let go of them.

Thanks in advance,
Tony Nichols
Design Engineer
Vesuvius USA
0 Likes
321 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Hi Tony,
First things first, you mentioned both 2002 and R14. Are you trying to
develop an app that will work across multiple versions of acad?
If you are, you may want to consider writing it entirely in lisp. R14.01
was the first non beta version of vba in acad and there are substantial
differences between the versions, one of which is a sychronous vs.
asychronous sendcommand method. It sounds to me that what you are trying
to accomplish is relatively simple using either "pure" vba in later
versions of acad or "pure" lisp in any version.
-Josh

Tony Nichols wrote:

> I am going crazy trying to determine an event to produce synchronous
> flow of the SendCommad method using Acad 2002. I am trying to put
> together a program to insert our title block based on units and scale.
> I have a user form ask for information regarding units and scale then
> build a SendCommand Lisp argument based on the user input and then
> execute the SendCommand method .
>
> A little background. We only use one size of paper and actually we have
> multiple title blocks in a single drawing file. This allows us to
> update all information in one file, due to SDI through R14. We have
> used templates DWT in the past and have 17 different DWT files based on
> units and scale. I have the job of maintaining these files and would
> rather not have to try to maintain 17 files. I want to use a DWG and
> insert it as a block to scale and set the dimscale and textsize system
> variables accordingly.
>
> So after the user responds to the user form the title block is brought
> in via the "ghost" image allowing the user to place the title block
> exactly were they would like it, hence the reason to use SendCommand
> instead of Insert method. Now the problem enters as I want to explode
> the title block so the attribute information can be updated and allow
> the system variables to be set. The problem is I have not found an
> event I can use to sense the command is synchronously complete because I
> am using a Lisp expression in my SendCommand method. All other code
> runs in the procedure before the block is placed into the file. So the
> find and explode procedure I call runs before it can find the block is
> in the drawing.
>
> I have tried using the LispEnd event of the document object but a call
> to the find and explode procedure happens before the block is placed
> because the Lisp routine has completed before the block is placed into
> the file. The same problem occurs if I call the procedure after the
> SendCommand method.
>
> I have looked at the AcadX.arx written by Tony Tanzillo. I have not
> fully digested all that can do as well as he makes the disclaimer not to
> include use of the object in high end production processes as the
> software is untested.
>
> If anyone has work around a similar problem I would appreciate the
> details of how you accomplished it. If anyone is doing a similar title
> block task I would be interested in the details, if you are willing to
> let go of them.
>
> Thanks in advance,
> Tony Nichols
> Design Engineer
> Vesuvius USA
>
>
0 Likes
Message 3 of 4

Anonymous
Not applicable
Tony - You can use this part of AcadX.arx for production work.

The classes that were descibed as having 'Beta' status have
been extensively tested and debugged, and are about to be
declared 'usable'.

The InsertDemo.zip sample included in AcadX shows how to do
exactly what you're after. In fact, you could just take
that demo app and modify the form to include your specific
data entry stuff, and it should get you where you want to
go.

If you have any questions, feel free to drop me a line.

"Tony Nichols" wrote in message
news:3C87A941.D437499E@vesuvius.com...
> I am going crazy trying to determine an event to produce synchronous
> flow of the SendCommad method using Acad 2002. I am trying to put
> together a program to insert our title block based on units and scale.
> I have a user form ask for information regarding units and scale then
> build a SendCommand Lisp argument based on the user input and then
> execute the SendCommand method .
>
0 Likes
Message 4 of 4

Anonymous
Not applicable
Move to Layouts and Mspace Pspace and you'll save yourself tons of
programing.
Layouts with predetermined scaled viewports and titleblock layouts can be
brought into a new drawing from a single master template with one
double-click.

Then use the LayoutSwitched event to read the viewport scale/layout, and set
the setvars based on that.

"Tony Nichols" wrote in message
news:3C87A941.D437499E@vesuvius.com...
> I am going crazy trying to determine an event to produce synchronous
> flow of the SendCommad method using Acad 2002. I am trying to put
> together a program to insert our title block based on units and scale.
> I have a user form ask for information regarding units and scale then
> build a SendCommand Lisp argument based on the user input and then
> execute the SendCommand method .
>
> A little background. We only use one size of paper and actually we have
> multiple title blocks in a single drawing file. This allows us to
> update all information in one file, due to SDI through R14. We have
> used templates DWT in the past and have 17 different DWT files based on
> units and scale. I have the job of maintaining these files and would
> rather not have to try to maintain 17 files. I want to use a DWG and
> insert it as a block to scale and set the dimscale and textsize system
> variables accordingly.
>
> So after the user responds to the user form the title block is brought
> in via the "ghost" image allowing the user to place the title block
> exactly were they would like it, hence the reason to use SendCommand
> instead of Insert method. Now the problem enters as I want to explode
> the title block so the attribute information can be updated and allow
> the system variables to be set. The problem is I have not found an
> event I can use to sense the command is synchronously complete because I
> am using a Lisp expression in my SendCommand method. All other code
> runs in the procedure before the block is placed into the file. So the
> find and explode procedure I call runs before it can find the block is
> in the drawing.
>
> I have tried using the LispEnd event of the document object but a call
> to the find and explode procedure happens before the block is placed
> because the Lisp routine has completed before the block is placed into
> the file. The same problem occurs if I call the procedure after the
> SendCommand method.
>
> I have looked at the AcadX.arx written by Tony Tanzillo. I have not
> fully digested all that can do as well as he makes the disclaimer not to
> include use of the object in high end production processes as the
> software is untested.
>
> If anyone has work around a similar problem I would appreciate the
> details of how you accomplished it. If anyone is doing a similar title
> block task I would be interested in the details, if you are willing to
> let go of them.
>
> Thanks in advance,
> Tony Nichols
> Design Engineer
> Vesuvius USA
>
0 Likes