Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Not opening a second instance of ACAD

12 REPLIES 12
Reply
Message 1 of 13
Anonymous
261 Views, 12 Replies

Not opening a second instance of ACAD

Brief intro: we're writing custom software for clients that sometimes
opens
AuotCAD to look at a drawing. Best thought of, for the purposes of this
discussion, as custom-written document management software. A few
questions:

Our users are on relatively slow computers running XP/SP2 - 2 gb memory
but
they're laptops and about 3 years old. Because AutoCAD takes a while to
load, one of the habits they've developed is opening AutoCAD once and
then
just opening and closing files using the current instance of AutoCAD.

Question - if inside our application, we shell out and run a commandline
that calls AutoCAD plus a file name to open that file, it will note
reuse the
current instance - it will open another. (We don't want to just let
Windows open the file because we have multiple versions of AutoCAD on
these
computers - for reasons beyond both my understanding and my control) and
it
opens the wrong version often enough that we need to build the entire
command line.

Another question - is there any API that AutoCAD exposes so that, e.g.,
we
can

CREATEOBJECT("AutoCAD.Application")

Thanks in advance. If it matters, we are working in Microsoft's Visual
Foxpro, versions 6 and 9.

-S-
12 REPLIES 12
Message 2 of 13
david21578
in reply to: Anonymous

I've used VisualBasic 3.0 to write an external file to run
from a shellout from autolisp. It worked fine as long as i used
Autocad 2002 but when I tried it in Autocad 2008
it did not work. So I added A Clock Routine or Pause
to allow the external program to finish running (at the 32 bit speed) before gong on to the next command from Autocad.
You may have a Speed issue.

Example:

Shell Out Command to external program

(Setq Count 0)
(While (/= Count 1000000) ; Change size as needed
(setq Count (+ Count 1))
)

Continue . . .
Message 3 of 13
Anonymous
in reply to: Anonymous

I'm not sure I understand how a speed issue is relevant here. If one
instance of AutoCAD is running, we want to use _that_ instance to open
the file of our choice. Timing shouldn't be relevant as the currently
running copy of ACAD could well have been running for an hour untouched
before we try to open a second file.

-S-


wrote in message news:5748748@discussion.autodesk.com...
I've used VisualBasic 3.0 to write an external file to run
from a shellout from autolisp. It worked fine as long as i used
Autocad 2002 but when I tried it in Autocad 2008
it did not work. So I added A Clock Routine or Pause
to allow the external program to finish running (at the 32 bit speed)
before gong on to the next command from Autocad.
You may have a Speed issue.

Example:

Shell Out Command to external program

(Setq Count 0)
(While (/= Count 1000000) ; Change size as needed
(setq Count (+ Count 1))
)

Continue . . .
Message 4 of 13
Anonymous
in reply to: Anonymous

AutoCAD's APIs provide a way to connect to a running
instance of it from another ActiveX client, and open a
file in that running instance.

Search the AutoCAD ActiveX/VBA documentation for
the Open() method.

Out of curiosity, why would you choose Visual FoxPro
as a development tool?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Steve Freides" wrote in message news:5748961@discussion.autodesk.com...
I'm not sure I understand how a speed issue is relevant here. If one
instance of AutoCAD is running, we want to use _that_ instance to open
the file of our choice. Timing shouldn't be relevant as the currently
running copy of ACAD could well have been running for an hour untouched
before we try to open a second file.

-S-


wrote in message news:5748748@discussion.autodesk.com...
I've used VisualBasic 3.0 to write an external file to run
from a shellout from autolisp. It worked fine as long as i used
Autocad 2002 but when I tried it in Autocad 2008
it did not work. So I added A Clock Routine or Pause
to allow the external program to finish running (at the 32 bit speed)
before gong on to the next command from Autocad.
You may have a Speed issue.

Example:

Shell Out Command to external program

(Setq Count 0)
(While (/= Count 1000000) ; Change size as needed
(setq Count (+ Count 1))
)

Continue . . .
Message 5 of 13
Anonymous
in reply to: Anonymous

We don't have that documentation because we don't own a copy of AutoCAD,
but I'll see if we can get it from our client.

VFP is has been the language of choice for us since it was a DOS
product. It is a very feature-rich, robust development language, IMHO.
I realize it's on the way out now but MS has said it will continue to
support the current version, which will be the last, until 2015, so
we've got some time to make other plans.

Back in the day, I wrote articles for Database Advisor magazine and was
a contributing editor for FoxPro Advisor magazine, as well as a speaker
at a couple of the developer's conferences, a beta tester, etc.

Whatever syntax works in VB should work basically unchanged for us as
well.

-S-

"Tony Tanzillo" wrote in message
news:5749009@discussion.autodesk.com...
AutoCAD's APIs provide a way to connect to a running
instance of it from another ActiveX client, and open a
file in that running instance.

Search the AutoCAD ActiveX/VBA documentation for
the Open() method.

Out of curiosity, why would you choose Visual FoxPro
as a development tool?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Steve Freides" wrote in message
news:5748961@discussion.autodesk.com...
I'm not sure I understand how a speed issue is relevant here. If one
instance of AutoCAD is running, we want to use _that_ instance to open
the file of our choice. Timing shouldn't be relevant as the currently
running copy of ACAD could well have been running for an hour untouched
before we try to open a second file.

-S-


wrote in message news:5748748@discussion.autodesk.com...
I've used VisualBasic 3.0 to write an external file to run
from a shellout from autolisp. It worked fine as long as i used
Autocad 2002 but when I tried it in Autocad 2008
it did not work. So I added A Clock Routine or Pause
to allow the external program to finish running (at the 32 bit speed)
before gong on to the next command from Autocad.
You may have a Speed issue.

Example:

Shell Out Command to external program

(Setq Count 0)
(While (/= Count 1000000) ; Change size as needed
(setq Count (+ Count 1))
)

Continue . . .
Message 6 of 13
Anonymous
in reply to: Anonymous

>> VFP is has been the language of choice for us
>> since it was a DOS product. It is a very feature-
>> rich, robust development language, IMHO.

I suppose that depends on one's definiton
of 'feature-rich and robust'.

I know plenty of Ex-VB6 programmers who, at
the time they were using it, felt the same way
about that tool. Wearing their favorite language
on their sleeve was considered normal.

Some 'graduated' to Delphi, and then to .NET and
VB.NET or C#. Others went directly to the one of
the latter.

What almost every one of them has in common,
is they openly admit they were wrong about VB6,
mainly because it was all they knew at the time
and naturally, saw as the cat's meow.

So, I have to respectfully disgree.

By today's standards, and in contrast to the state
of the art tools available now, I wouldn't regard
VFP as being feature-rich and robust. By dBaseII
standards, or more generally by the state of the
art as it existed 10 years ago, VFP could be seen
as feature-rich and robust. But, not today.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
Message 7 of 13
Anonymous
in reply to: Anonymous

Hi Tony,

I doubt anyone denies that you can do some things with .NET that you can't
do with older languages. However, not every program requires that those
things be done.

There are lots of programs, that merely require gathering data from a file,
processing the data either as string handling, or arithmetical operations
and writing the data back to a file. One does not need "feature richness"
for this type of program.

Hence it is entirely feasible that an older programming language can meet
the needs of some programmers - and particularly so when they have long
experience of the program. They have the sense to recognise that and do not
get involved in an ego-tripping "mine is bigger than yours" race. Nor do
they need to waste their time in an unnecessary learning exercise.

Changes in computer hardware and O/Ss to run on that hardware will
eventually make the older "language/program developed with language"
un-viable. However, the time lags involved in this are quite high and
solutions provided through the older systems can remain viable into the
immediately foreseeable future.

--

Laurie Comerford
CADApps
www.cadapps.com.au
www.civil3Dtools.com

"Tony Tanzillo" wrote in message
news:5749304@discussion.autodesk.com...
>> VFP is has been the language of choice for us
>> since it was a DOS product. It is a very feature-
>> rich, robust development language, IMHO.

I suppose that depends on one's definiton
of 'feature-rich and robust'.

I know plenty of Ex-VB6 programmers who, at
the time they were using it, felt the same way
about that tool. Wearing their favorite language
on their sleeve was considered normal.

Some 'graduated' to Delphi, and then to .NET and
VB.NET or C#. Others went directly to the one of
the latter.

What almost every one of them has in common,
is they openly admit they were wrong about VB6,
mainly because it was all they knew at the time
and naturally, saw as the cat's meow.

So, I have to respectfully disgree.

By today's standards, and in contrast to the state
of the art tools available now, I wouldn't regard
VFP as being feature-rich and robust. By dBaseII
standards, or more generally by the state of the
art as it existed 10 years ago, VFP could be seen
as feature-rich and robust. But, not today.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
Message 8 of 13
Anonymous
in reply to: Anonymous

Well, that's all fine, but I really didn't come here to debate computer
programming languages, present or past, just to get an answer to my
question(s).

FWIW, I loath Microsoft. We have a client who runs a program that, for
the first time, uses .NET. They're used to getting upgrades to address
bugs and add features, but they're really disappointed with this upgrade
because - surprise, surprise - it now runs slower.

All _that_ said, I would still be delighted to see sample code in the
language of anyone's choice that opens ACAD then opens a file, and then
uses the same handle to open a second file.

Thanks in advance.

-S-

"Tony Tanzillo" wrote in message
news:5749304@discussion.autodesk.com...
>> VFP is has been the language of choice for us
>> since it was a DOS product. It is a very feature-
>> rich, robust development language, IMHO.

I suppose that depends on one's definiton
of 'feature-rich and robust'.

I know plenty of Ex-VB6 programmers who, at
the time they were using it, felt the same way
about that tool. Wearing their favorite language
on their sleeve was considered normal.

Some 'graduated' to Delphi, and then to .NET and
VB.NET or C#. Others went directly to the one of
the latter.

What almost every one of them has in common,
is they openly admit they were wrong about VB6,
mainly because it was all they knew at the time
and naturally, saw as the cat's meow.

So, I have to respectfully disgree.

By today's standards, and in contrast to the state
of the art tools available now, I wouldn't regard
VFP as being feature-rich and robust. By dBaseII
standards, or more generally by the state of the
art as it existed 10 years ago, VFP could be seen
as feature-rich and robust. But, not today.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
Message 9 of 13
Anonymous
in reply to: Anonymous

"Laurie Comerford" wrote

>> However, not every program requires that those
>> things be done.

Real, competent software developers do not think
that way.

They don't simply and ignorantly look at only what
'a program requires'. They don't design software or
formulate functional requirements to suit their own
limitations, including the limitations of whatever
development tools they are limited to using.

Or put more simply, the cart does not pull the horse.

They consider software to be a long-term investment
that will _evolve_, and need to do additional things in
the future, which they may not be able to anticipate,
or foresee.

Telling a customer they don't need their software to do
something, only because you don't know how to make
it happen, or can't with the limited tools you have access
to, is not just disingenuous, it is more like outright fraud,
of the type that we routinely see from street-corner con-
artists. Pick a card, any card.

When a consumer advertises for programming help,
they state specific requirements and skill levels with
specific tools. The don't simply say 'hey, we need a
programmer, and any piece of garbage/stone-age
tool that you're limited to using, is just fine with us'.

You also seem to routinely confuse two basic types
of programmers: Domain experts whose primary job
title is not professional programmer, and people who
are (or puport to be) in the business of providing
programming services to others on a professional basis.

Consumers of their services have a right to hold the
professional programmer, whether they be consultants
or hired employees, to a different set of standards
insofar as software engineering competence goes.

People who pay money to have software developed, are
only subjected to great harm as a result of dealing with
people who like yourself, exclusively and ignorantly view
everything in terms of their own personal limitations.

Don't pretend to be that which you are not, and you
will never have to look or feel stupid.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
Message 10 of 13
Anonymous
in reply to: Anonymous

>> FWIW, I loath Microsoft. We have a client who
>> runs a program that, for the first time, uses .NET.
>> They're used to getting upgrades to address bugs
>> and add features, but they're really disappointed
>> with this upgrade because - surprise, surprise - it
>> now runs slower.

What a shocker. I certainly wasn't expecting an
unbiased opinion on .NET from a VFP programmer 🙂

Basically, it's a fairly common for those who aren't
able to access new technology, to routinely and
opportunistically obliterate it with uneducated and
largely baseless slander.

.NET is a dynamic execution environment, but it isn't
fair to only consider or point out the most obvious
disadvantage, even if you were familiar with all the
advantages that clearly outweigh that. Yes of course,
its slower.

But that's because .NET is designed for the future,
rather than to cater to the limitations of those who
stubbornly choose to remain stuck in the past.

It is designed for a future where some of what it must
now do in software, will eventually be offloaded to
hardware. Your watch; cellphone/pda; toaster oven;
TV; and your car will some day be running what the
CLR eventually evolves into.

The Delphi code that I've ported to .NET runs about
10x slower than it did in native Win32. I was able to
solve most of the issues related to performance by
combining managed code with native code that was
ported to C++.

There's no mandate or requirement that an application
must be written entirely in managed code. The only
requirement is that a developer must be skilled and
able to implement the performance-critical aspects in
native code (e.g., C++).

As far as bugs goes, it's not too terribly uncommon to
find more of them in applications that are migrated
to a new environment and possibly rewritten from the
ground up to leverage what the environment offers.

But, the thing I like the most about .NET, is that it
also seems to have the unintended side-effect of
'shaking out' the imposters and charletans.

That is, people who after having written a couple of
'applications' in VB or some similar 'easy-to-use' tool
like that, fraudulently misrepresent themsleves as
competent, qualified software developers.

If they manage to find some unsuspecting sucker to
hire them and get their foot in the door, what ensues
usually culminates in the form of a mushroom cloud.

I only know that, because of the number of times
I've found myself in the unenviable position of being
tasked with cleaning up the mess.

Regarding your need for a sample, there is sample
code included with the docs.

Assuming you have them, the task is very simple and
basic, to the point where you should be able to figure
it out easily from the docs for the method I pointed
you to in a previous post.

You can also search this newsgroup and other online
resources for sample code that does what you need
to do, and because it is so basic a task, the odds you
will find plenty of it are fairly good.

If you want first-class service or a drop-in solution,
free free to contact me via email and I'll be more
than happy to give you a quote.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
Message 11 of 13
Anonymous
in reply to: Anonymous

Based on how you've conducted yourself in this conversation, you would
be the last person I would pay for assistance with anything.

Have a nice day.

-S-

"Tony Tanzillo" wrote in message
news:5749786@discussion.autodesk.com...

If you want first-class service or a drop-in solution,
free free to contact me via email and I'll be more
than happy to give you a quote.
Message 12 of 13
Anonymous
in reply to: Anonymous

Thank you for the complement.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Steve Freides" wrote in message news:5750008@discussion.autodesk.com...
Based on how you've conducted yourself in this conversation, you would
be the last person I would pay for assistance with anything.

Have a nice day.

-S-

"Tony Tanzillo" wrote in message
news:5749786@discussion.autodesk.com...

If you want first-class service or a drop-in solution,
free free to contact me via email and I'll be more
than happy to give you a quote.
Message 13 of 13
Anonymous
in reply to: Anonymous

Compl_i_ment.

-S-


"Tony Tanzillo" wrote in message
news:5750096@discussion.autodesk.com...
Thank you for the complement.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Steve Freides" wrote in message
news:5750008@discussion.autodesk.com...
Based on how you've conducted yourself in this conversation, you would
be the last person I would pay for assistance with anything.

Have a nice day.

-S-

"Tony Tanzillo" wrote in message
news:5749786@discussion.autodesk.com...

If you want first-class service or a drop-in solution,
free free to contact me via email and I'll be more
than happy to give you a quote.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost