VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PUBLISH command causes fatal error

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
234 Views, 2 Replies

PUBLISH command causes fatal error

Hi

I've made an VBA macro that makes a *.DSD file. Then I use the -PUBLISH
command with the dsd-file as an argument to create a multipage DWF.
However...
If a VBA macro is run directly before the publish command is issued, a Fatal
Error occurs.
i.e. if i place THIS on a button:

^C^C-vbarun;Jadda;(setq oldDia (getvar "FILEDIA"))(setvar "FILEDIA"
0)(command "_-PUBLISH" "C:/Documents and Settings/6TROLIE/Local
Settings/Temp/MPDWF.DSD")(setvar "FILEDIA" oldDia);

AutoCAD crashes when I press it.

iI i put

^C^C-vbarun;Jadda;

and

(setq oldDia (getvar "FILEDIA"))(setvar "FILEDIA" 0)(command "_-PUBLISH"
"C:/Documents and Settings/6TROLIE/Local Settings/Temp/MPDWF.DSD")(setvar
"FILEDIA" oldDia);

on two separate buttons, and press them in order, everything works fine.
The DVB file only consist of 1 module with this:

Public Sub Jadda()
End Sub


I've tried this on both AutoCAD 2004, Architectural Desktop 2004 and
Mechanical 2004.
Does anyone know anything about this?


Regards

Trond Hasse Lie
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

Well, first off why are you setting variables thru lisp in a button?
Buttons are for macros - why make things hard? Just use ^C^C-
vbarun;jadda;setvar;useri1;(getvar"filedia");filedia;0;-
publish;"....dsd";filedia;(getvar"useri1");

Second, why not include all of this in your vba program to begin with?

Third, what does jadda do? It could be causing an problem with the
publish command.
___________________________
Mike Tuersley
AutoCAD Clinic
Rand IMAGINiT Technologies
Message 3 of 3
Anonymous
in reply to: Anonymous

Well I could of course use standard commands for the FILEDIA oart, but you
HAVE to use lisp for the PUBLISH command. Try using a \ (Backslash) in the
command and you'll know what i mean.

Second.. I've tried using Sendcommand etc. for the Publish-part, but it
fatal errors then too. The Publish command doesn't have an API so I have to
use sendcommand. And the REASON I use the Publish command is that it is the
only way to make a MulitPage DWF via VBA.

Third.. As I wrote.. "Jadda" does NOTHING. the code is:
Public Sub Jadda()
End Sub

The problem is: IF I run a VBA macro (even if the macro doesn't do anything)
right before executing the publishcommand, Autocad crashes. If I run the VBA
macro on one button, and run the publishcommand on another button,
everything is just fine.

Trond Hasse Lie

"Mike Tuersley" wrote in message
news:MPG.19dd27363c43e26498977a@discussion.autodesk.com...
> Well, first off why are you setting variables thru lisp in a button?
> Buttons are for macros - why make things hard? Just use ^C^C-
> vbarun;jadda;setvar;useri1;(getvar"filedia");filedia;0;-
> publish;"....dsd";filedia;(getvar"useri1");
>
> Second, why not include all of this in your vba program to begin with?
>
> Third, what does jadda do? It could be causing an problem with the
> publish command.
> ___________________________
> Mike Tuersley
> AutoCAD Clinic
> Rand IMAGINiT Technologies

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

Post to forums  

Autodesk Design & Make Report

”Boost