Jump to content

how to raise exception if autocad is not installed in my system


srikanthkamuju

Recommended Posts

Hi All,

 

I am working on VB as front end and back end as autocad.

 

my requirement is if autocad is not installed in my system . when ever my application runs it will display a message autocad is not installed in your system

 

 

thanks in advance

Link to comment
Share on other sites

Your request is a bit puzzling. How would you not know that AutoCAD was loaded on your system? I know exactly what is loaded on my computer and I don't even have to turn it on and run a code.

 

Even if you were to go to a computer that isn't yours, figuring out if AutoCAD were loaded on it without running any code would seem fairly simple to determine. Maybe I'm missing something here. What exactly are you trying to accomplish?

Link to comment
Share on other sites

Your request is a bit puzzling. How would you not know that AutoCAD was loaded on your system? I know exactly what is loaded on my computer and I don't even have to turn it on and run a code.

 

Even if you were to go to a computer that isn't yours, figuring out if AutoCAD were loaded on it without running any code would seem fairly simple to determine. Maybe I'm missing something here. What exactly are you trying to accomplish?

 

for example:

 

If i develop one project in vb. suppose if i will that project .

 

while loading my project first it load autocad application

 

if the autocad is not installed then it should display a message

Link to comment
Share on other sites

You may try something like this:

 

Function IsAcadAvailable() As Boolean
On Error GoTo ErrAction

   Set theAcadApp = CreateObject("AutoCAD.Application")   'call default version
   IsAcadAvailable = True
   Set theAcadApp = Nothing

ExitAction:
   Exit Function
ErrAction:
   IsAcadAvailable = False
   Resume ExitAction
End Function

 

Regards,

Link to comment
Share on other sites

@ReMark: It is a good programming practice to ensure that the workstation where your application will be used has the required resources; since sometime he have no information about the user some validation tests are mandatory. In this case, if I understand correctly, the OP wants to access AutoCAD from a stand-alone application written in Visual Basic. So, his application, instead of crashing each time the user try to start it, it will inform him/her that an AutoCAD installation is required to use that tool.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...