Saturday, November 21, 2009
Home   |   Search   |   About AUGI   |   My AUGI   |   Join Now

Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP
 Welcome, Guest. 

Login

Join Now FAQ Members List Calendar Search Today's Posts Mark Forums Read

AutoLISP AutoLISP or Visual LISP, learn both here!

Reply
 
Thread Tools Display Modes
Old 2004-07-28, 05:00 PM   #1
msretenovic
I could stop if I wanted to
 
msretenovic's Avatar
 
Join Date: 2002-02
Location: Galloway, Oh
Posts: 227
msretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of light
Angry vla-saveas....

Hi all,

I have run into a problem with vla-saveas. I have this line of code in my routine:

Code:
(vla-saveas dbxDoc dwgName ac2000_dwg)
I recieve an error on this line. The error is:
Quote:
; error: Exception occurred: 0xC0000005 (Access Violation)
; warning: unwind skipped on unknown exception
If I use
Code:
(vla-saveas dbxDoc dwgName nil)
instead, everything works fine . The problem is that it will save it to the 2004 format, I need to leave the drawing(s) in the 2000 format (at least until we upgrade later this year).

TIA
__________________
Michael K. Sretenović
Quote:
Most folks are about as happy as they make up their minds to be.
-Abraham Lincoln (1809-1865)
-16th president of The United States of America (1861 - 1865)
msretenovic is offline   Reply With Quote
Old 2004-07-28, 08:13 PM   #2
RobertB
Administrator
 
RobertB's Avatar
 
Join Date: 2001-08
Location: Seattle WA US
Posts: 4,393
RobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the stars
Exclamation RE: vla-saveas....

You cannot do that with ObjectDBX.

If you use the type library's version of SaveAs, and not AutoCAD's version, that argument is not there. (See attached screen shot)
Attached Images
File Type: png SaveAs.png (5.2 KB, 31 views)
RobertB is offline   Reply With Quote
Old 2004-07-28, 08:21 PM   #3
msretenovic
I could stop if I wanted to
 
msretenovic's Avatar
 
Join Date: 2002-02
Location: Galloway, Oh
Posts: 227
msretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of light
Question RE: vla-saveas....

I'm confused then because I found this in the help ("VBA and ActiveX documentation set" "SaveAs method"):

Quote:
AcSaveAsType enum; input-only; optional for Document objects
ac2000_dwg
AutoCAD 2000 DWG (*.dwg)

ac2000_dxf
AutoCAD 2000 DXF (*.dxf)

ac2000_Template
AutoCAD 2000 Drawing Template File (*.dwt)

ac2004_dwg
AutoCAD 2004 DWG (*.dwg)

ac2004_dxf
AutoCAD 2004 DXF (*.dxf)

ac2004_Template
AutoCAD 2004 Drawing Template File (*.dwt)

acNative
A synonym for the latest drawing release. In this release, this value equals ac2004_dwg.
Am I taking this out of context?
__________________
Michael K. Sretenović
Quote:
Most folks are about as happy as they make up their minds to be.
-Abraham Lincoln (1809-1865)
-16th president of The United States of America (1861 - 1865)
msretenovic is offline   Reply With Quote
Old 2004-07-28, 09:06 PM   #4
RobertB
Administrator
 
RobertB's Avatar
 
Join Date: 2001-08
Location: Seattle WA US
Posts: 4,393
RobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the stars
Default RE: vla-saveas....

Quote:
Originally Posted by msretenovic
I'm confused then because I found this in the help ("VBA and ActiveX documentation set" "SaveAs method"):
Am I taking this out of context?
Yes. That method you are looking at is for an AcadDocument, not an AxDbDocument. Some methods and properties available in normal AutoCAD will not be available, or even the same, in an ObjectDBX document.

However, I may have mispoken on the (vla-SaveAs) approach too. Please try this code:
Quote:
Originally Posted by whdjr
(vlax-invoke-method dbxdoc 'saveas filename)
in your situation, and provide the bogus argument for filetype. Does the C05 occur? Or do you get an invalid argument? It may be an issue with the ActiveX interface.

I did a (vlax-dump-object dbxdoc T) and notice that the SaveAs method for a DBXDoc only accepts two arguments:
; SaveAs (2)

Therefore (vla-SaveAs dbxdoc ...) ought to be running the object's version of SaveAs. But if that call is accepting 3 arguments, something weird is going on.
RobertB is offline   Reply With Quote
Old 2004-07-28, 09:47 PM   #5
msretenovic
I could stop if I wanted to
 
msretenovic's Avatar
 
Join Date: 2002-02
Location: Galloway, Oh
Posts: 227
msretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of light
Question RE: vla-saveas....

Robert,

I have tried to use the method you mentioned. I tried it three ways:

Code:
(vlax-invoke-method dbxDoc 'saveas dwg) ;;<-- No Error
(vlax-invoke-method dbxDoc 'saveas dwg nil) ;;<-- No Error
(vlax-invoke-method dbxDoc 'saveas dwg ac2000_dwg) ;;<-- Same error as before
The first two methods went through without a problem. But the third gave the same error that I had previously . I understand if it is only supposed to accept two arguments and it works on the first one. But, if accepts three and works on the second one but not the third, I don't understand .

If you have any ideas, I'm willing to try them...
__________________
Michael K. Sretenović
Quote:
Most folks are about as happy as they make up their minds to be.
-Abraham Lincoln (1809-1865)
-16th president of The United States of America (1861 - 1865)
msretenovic is offline   Reply With Quote
Old 2004-07-29, 12:04 AM   #6
RobertB
Administrator
 
RobertB's Avatar
 
Join Date: 2001-08
Location: Seattle WA US
Posts: 4,393
RobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the stars
Default

Well, the flat-out answer is that ObjectDBX does not support saving to other versions. That can be seen in the VBAIDE.
RobertB is offline   Reply With Quote
Reply


Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
AutoCAD chokes on script file michael.12445 AutoCAD Customization 9 2004-06-24 03:20 AM


All times are GMT +1. The time now is 11:40 AM.