News:

Please note new Forum URL: forum.designcad.com

Main Menu
DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Darn cached files...

Started by Bob P, April 29, 2010, 03:43:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bob P

In my old DOS days, I faked Windows' copy and paste by saving the entity to a temporary file on the hard drive.  Then I could retrieve the file when "pasting".  I had multiple "copy"s that created multiple files I could retrieve individually.  Very convenient to have multiple files to "paste".

So I'm trying to do the same thing in Windows, but running into DC's friggin' cache-file problem.

If I save an entity to cut1.d3m, that file will be correctly retrieved.
If I repeat the macro, to replace cut1.d3m with a new file, the old file will still be retrieved, even though the file has actually been changed.  Interestingly enough, the box containing the entity will "surround" the new file shape, but when the file is placed, it's the old file.  >:(

At any rate (I just wanted to vent...), I think I'm going to get around the problem by a rather circuitous path.  I'm going to name each new instance with a sequential number (cut101.d3m, cut102.d3m, cut103.d3m, etc), then search for the highest number when pasting.  I will have to delete all the files at the end of the session.  I hate when things get unnecessarily complicated.

When things are working, I'll paste the results.

dcadRob

I don't understand what sequence of steps you are using which produces this unusual result. Would you care to vent in more detail?

Bob P

This was covered some time ago, although I don't remember the details.

Situation: Save a section of the current drawing to figure1.dcd
Insert figure1.dcd into the current drawing.  It's correct.
Save a different section of the current drawing to the original figure1.dcd name, replacing it.
Import the new figure1.dcd to the current drawing.  It will be the OLD drawing, not the new one.

Dr PR

Bob P,

You have lost me on this one. You use terms "copy", "paste", "save", "import", "retreived", etc. These are all very different operations in DesignCAD.

Why are you saving drawings as ".d3m" files?

How do you open a file while pasting?  All versions of DesignCAD that I have will not allow this.

How do you import a ".dcd" file? All versions of DesignCAD that I have will not allow this.

I have saved modified DesignCAD files using the name of an older existing file many times and I have never seen the problem of having the older (unmodified) file opening when I open the file at a later date.

You need to explain exactly what you are trying to do.
DesignCAD user since 1987

dcadRob

I don't understand how you 'insert' or 'import' these files once they are saved.

Bob P

The original post's file names were in error.  The extension should have been dcd.

Here are my macros:

'cpy1.dcm  Saves a selection to a file.

if sys(80)=0 then
  Message "Nothing selected. . . routine will end, press any key"
  END
end if

sys(36)=1

>saveselected
{
<Filename "d:\dcmax15\temp\cut1.dcd"
}
sys(36)=0

end
_______________________________________________________

The macro to "paste" the previously saved selection into the current drawing:

'Program: past1.d3m (paste from file)

>SymbolLoad
{
<filename "d:\dcmax15\temp\cut1.dcd"

<Scale 1
}

end


Lar

#6
What Bob is doing is, rather than copy to the clipboard, he saves a selection to another filename, like when you save-as with the 'selected only' option. Then, rather than pasting (which he can't do anyway because he never copied the stuff)  he loads the file as a symbol. Then later on he may save something else but when he loads this one (which is something other than the first selection set) it comes in with the correct bounding box but once the symbol materializes it resembles the 1st selection set.

This is the dreaded Cached Effect, where dcad stores the first loading of a filename in memory so if you ever load that filename again it displays the memorized version, even though the user may have changed the contents of that filename. This also happens with blocks and bitmaps. A classic example of how the road to hell is paved with good intentions (of the original developers).

When loading a symbol you can 'load as original entities' to correct this, but it won't be a symbol anymore. With bitmaps the only solution is to save, close and reopen dcad.

What I would like to know is how did Bob write that macro in the old DOS days. The only thing I remember us having back then was the original 'Block' - not today's Block, but what we now call a Group. I don't remember symbols coming along until a few versions into Windows.

Lar

Bob P

#7
Here are my original DOS macros:

'This copies a section of a drawing to \temp\cut.dw2
'record the Manip layer mode
MAN=SYS(26)
SYS(26)=0
IF SYS(1)<2 THEN GOTO MKPT
POINTVAL X Y 1
IF SYS(1)=2 THEN
>POINTXYZ [X, Y]
ELSE
ENDIF
BACK:
>SELECTSAVE D:\DC\TEMP\CUT Y
SYS(26)=MAN
GOTO END

MKPT:
SYS(1)=0
SETPOINT "Set 2 points to define selection and 1 or 2 for handle(s) " 4
GOTO BACK

END:
______________________________________________________

and "paste":

'This inserts a drawing from \temp\cut.dw2.  Usually I first set a point to load the selection at a certain location.
>LOAD D:\DC\TEMP\CUT
END:

I have equivalent macros for DC DOS 3D, except they use blocks (block save and block load).

dcadRob

So a bug in DC.

Maybe you should try multi-clipboard software. It lets you accumulate several items from the clipboard and then paste the one you want somewhere. I looked around on download.cnet.com and found 'M8 Free Clipboard'. I haven't used it but it looks promising.

Bob P

A few years ago, I tried a multi-clipboard (for another reason), and found it conflicted with some functions in other programs that I use.  Nothing's ever simple.

But I've been thinking about my sequential method and I think it will be pretty easy to implement.  Just not this week...

JJG

#10
If this can reassure BobP, the same error occured in DC 15 when importing a picture: if you had imported a picture into a drawing during a DesignCAD's session, then you'd edited the file of the same picture, then removed this picture from the drawing, and then imported it again this (edited) picture (which one have the same name), you get the old version of the image (that is to say, the image like you had imported the very first time).
The solution was to close the session DesignCAD, then open a new one.
Since the last version of DesignCAD  I use (DesignCAD Pro 7000, French version of DC 18, and Windows XP pro), this problem is apparently solved.

bdeck

#11
Hi BobP,

The Merge command "SHOULD" work for this application. But it doesn't.

It's real buggy, and completely nonfunctional for its stated purpose.

It thinks it is a SymbolLoad  command, with all the baggage that goes with that.

Also it gets confused if it has to display the file selector.

I'm getting in on this a little late, but here's a macro that gets around those bugs by using the merge command in a new window.
(If you dont mind using the clipboard briefly)

A simpler version follows using the open command.

BD

This version shows the files selector bug in the Merge command (if the error handling is commented out):
sys(36)=1
>New
{
}
>Merge                                        ' SymbolLoad command could be used here just as well
{
<PointXYZ 0.0000, 0.0000, 0.0000
<Filename "d:\dcmax15\temp\cut1.dcd"         'Path and filename MUST BE CORRECT !!!!
<Type 1                ' selected
<Scale 1               ' fixed scale
}

if sys(80)=0 then   ' necessary to correct bug in Merge command if file cannot be found
message "Failure, file will not be loaded. Ignore file selector."
>Close  'close the new window
{
<SaveChanges 0
}
end
endif

>Copy
{
}
>Close
{
<SaveChanges 0
}

sys(36)=0

>Paste
{
<Type 1
}


Here's a better version that works with the file selector if necessary:

sys(36)=1
sys213=sys(213)
>OPEN
{
<Filename "d:\dcmax15\temp\cut1.dcd"  
}

if sys(213)=sys213 then  'optionally display fileselector if necessary
>OPEN
{
}
endif

if sys(213)=sys213 then
message "failure"
end
endif

if sys(9) >0 then

>SelectAll
{
}
>Copy
{
}
gotclip=1
endif

>Close
{
<SaveChanges 0
}

sys(36)=0
if gotclip then
>Paste
{
<Type 1
}
endif
end


Note that even the OPEN command fails to open the dialog box on its own if it cant find the specified file. Is this an option setting?


bdeck

#12
The macros in hte prior post have been corrected as follows:

"sys(36)=2"

changed to

"sys(36)=1"



"If sys(9) then"

changed to

"If sys(9)>0  then"


My simple test on late changes failed to detect these critical problems.

Also, substituting SymbolLoad for merge in the first version works well except that it demands a user-set handle. Dunno why.

BD