News:

Please note new Forum URL: forum.designcad.com

Main Menu

saveas

Started by bdeck, May 02, 2014, 03:16:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bdeck

(Edit: problem solved with settings provided by Prl below.)

The following code works correctly  on DC versions 15-20.

In DC version 23.0/23.1 ( win2K & win7 ) the code:
1) fails to hide the print dialog and
2) fails to set the parameters correctly.

When the saveas subroutine is included in the macro vdd09d.d3m,  the
the dialog also fails to get focus from the DC window. (appears to be multithreading in some odd way)

BD

' this macro works correctly on prior versions (17.2, 20) but in DCv23.1 it

'1) fails to hide the saveas dialog
'2) fails to populate the saveas dialog with the correct parameters

sys(470)=1

dir$=sys$(20)

fext$=".dcd"

gosub timAndDate

file$=dir$+"\test"+dt$+"_"+tm$+fext$

print "Hit any key to save ", file$
anykey
gosub dcsaver
end

dcsaver:
>SaveAs          ' dc23 on win2k fails to hide the dialog here on my machine
{
<SelectOnly 0     
<Save2D 3        'fails with or without this parameter
<Filename [file$]
}
    return

TimAndDate:
t$=sys$(7) ' get time of day
t1$=left$(t$,2)
t3$=right$(t$,2)
t4$=right$(t$,5)
t2$=left$(t4$,2)
tm$=t1$+t2$+t3$
d$=sys$(8) ' get date
d1$=left$(d$,2)
d3$=right$(d$,2)
d4$=right$(d$,5)
d2$=left$(d4$,2)
dt$=d3$+d1$+d2$
    return

prl

#1
Bd,

Seems we had some issues with the autopacking.  It affected all the saving commands.

Add this to your code ahead of everything and see if it helps:

sys(1174)=0


Also, I ran your above test code and on my version 23 and  it is fine, even though I don't have that line in there.  I'll try and remember how this was resolved.

prl

#2
Bd,

OK, I remember sort of.  I don't know where this switch is toggled in the GUI but if you edit your DC_General.ini file, the first line should be set to zero.  sys(1174)=0 does that too.


[General Options]
PackIDsOnSave=0
OffScreenBitmap=0
ShowToolTips=0
SelectAsCreated=0
.
.
.
.

bdeck

#3
prl,

Either of your two solutions works perfectly. Many thanks.

At the same time I was seeing this problem, I was also seeing a problem with image saves where the save menu was included in the saved image. Thought maybe DC was doing some multithreading. I had solved the menu persistence problem by adding a wait variable to the program.

Fixing the PackID problem allowed me to concentrate on the persistence problem.

Turns out the settings on my (relatively) new laptop had been set to fade windows when closing. (start/computer/properties/advanced/performance/visual effects/)  Turned off that switch, and voila.

BD

prl

#4
Quote from: bdeck on May 03, 2014, 09:10:27 AM
I was also seeing a problem with image saves where the save menu was included in the saved image

Yes, if you have DesignCAD snapping pictures using basiccad and you decide to check your email or whatever and a portion of that other program's window laps the DesignCAD frame, guess what, that is included in your graphic snapshot. 

Also don't forget about sys(36)=2,  run silent run deep mode for most of those pesky dialogs.

bdeck

Also, setting DC options to use an offscreen bitmap does not seem to affect the saved image.
That's OK.  Problem solved.
BD