Author Topic: saveas  (Read 1932 times)

bdeck

  • Hero Member
  • *****
  • Posts: 827
saveas
« on: May 02, 2014, 03:16:16 PM »
(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

Code: [Select]
' 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
« Last Edit: May 03, 2014, 09:13:15 AM by bdeck »

prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Re: saveas
« Reply #1 on: May 03, 2014, 04:58:44 AM »
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.
« Last Edit: May 03, 2014, 05:38:32 AM by prl »

prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Re: saveas
« Reply #2 on: May 03, 2014, 05:50:17 AM »
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
.
.
.
.
« Last Edit: May 03, 2014, 06:00:01 AM by prl »

bdeck

  • Hero Member
  • *****
  • Posts: 827
Re: saveas
« Reply #3 on: May 03, 2014, 09:10:27 AM »
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
« Last Edit: May 13, 2014, 04:45:32 PM by bdeck »

prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Re: saveas
« Reply #4 on: May 03, 2014, 09:19:08 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.
« Last Edit: May 03, 2014, 09:27:29 AM by prl »

bdeck

  • Hero Member
  • *****
  • Posts: 827
Re: saveas
« Reply #5 on: May 03, 2014, 10:39:35 AM »
Also, setting DC options to use an offscreen bitmap does not seem to affect the saved image.
That's OK.  Problem solved.
BD