Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open AutoCAD drawing from Access

Status
Not open for further replies.

CMPaccess

Technical User
Dec 18, 2003
52
AU
I'm trying to open a specific autoCAD drawing from access.

My code is :-

stAppName = "C:\Program Files\AutoCAD 2005\acad.exe"
stFilename = Me.CADFilename & ".dwg"
stPath = Me.Path
FullSpec = stAppName & " " & stPath + stFilename
Call Shell(FullSpec, 1)

This opens AutoCAD but will not find the file. It does not recognise the network drive.

I think the problem is related to the fact that the path is set to J:\ but in actual fact the name would be \\myserver01\jobs\.

However if you enter the path using the J: method manually it works.

My second question would then be what is the best method to send specific commands to autoCAD once the drawing is open.

Thanks
 
Can autoCAD be driven by OLE Automation ?
If yes, take a look at the GetObject function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PH,

Any tips on how to do that. You are right in that you can use the GetOBjectFunction but seems more complicated.

Will take a look though.
 
PH,

I have managed to get the Getobject to work.

However, If AutoCAD is already open I cannot get the window to become visible above the database.

Can this be done ??

This is not a problem if AutoCAD is not open.

Cheers
 
Unfortunately I don't know the first thing about the AutoCAD object model.
Have you tried to play with the AppActivate instruction ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top