Author Topic: Sample program highlighting DesignCAD name cache defect  (Read 633 times)

prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Sample program highlighting DesignCAD name cache defect
« on: October 02, 2014, 06:14:17 AM »
Since I mentioned this in a previous topic, a sample program to add some visual clarity.  Specifically, the merge command and a wide range of drawing load commands (block load, symbol load, merge, etc.) are affected by the embedded drawing caching defect.  This nasty defect comes around in many different ways.

Summary:

Once you load a part (symbol or block or merge) into an existing drawing, and then you separately edit the original symbol or block on the hard disk, you can't reload that symbol or block into your master drawing.  DesignCAD refuses to overwrite the previously internal cached version with the harddisk version.  The only way to load the edited symbol or block from disk is to give it a new unique name, something DesignCAD hasn't loaded previously. 


Code: [Select]
'Program: mergedefect.d3m
' Used to demonstrate the merge defect

'open a new blank drawing
>new
{
}

'work in 3d mode
if sys(344) then
  >2DMode
   {
   }
endif

>Box
{
<color 0, 0, 255
<layer 1
<pointxyz 0, 0, 0
<pointxyz 30, 20, 10
}

>Cone
{
<Color 255, 0, 0
<Orientation 1
<Pointxyz 0, 0, 0
<Pointpolar 10, 30, 2
<Pointxyz 0, 10, 0
}


>Cylinder
{
<Color 0, 255, 0
<NFace 20, 8, 8
<Radius 0.5, 1
<Pointxyz 0, 0, 0
<Pointxyz 6, 0, 0
<Pointxyz 6, 16, 0
}

>fittowindow
{
}

>Zoom
{

<Zoomfactor .50
<Pointxyz 0, 15, 0
}

>saveas
{
<SelectOnly 0
<FileName "mergedefectsample.dcd"
}

Message "You should have a blue box, a red cone, and a green cylinder."
Message "The code will next select the blue box and save it as CLIP1.DCD"

sys(80) = 0
>pointselect
{
<pointxyz 30, 20, 10
}

>saveas
{
<SelectOnly 1
<FileName "clip1.dcd"
}
sys(80)=0

Message "Next the code will launch the merge command. You may have to navigate to your basiccad directory. Please select the CLIP1.DCD drawing and insert it anywhere"
>merge
{
<incomplete
}
sys(80) = 0
Message "So far so good. You've loaded another blue box."
Message "The code will next select the green cylinder and save it as CLIP1.DCD"

>pointselect
{
<pointxyz -6, 0, 0
}

>saveas
{
<SelectOnly 1
<FileName "clip1.dcd"
}
sys(80)=0


Message "AGAIN the code will launch the merge command. AGAIN please select the CLIP1.DCD, THE GREEN CYLINDER, and insert it anywhere."
>merge
{
<incomplete
}

sys(80) = 0
>fittowindow
{
}

regen
Message "Didn't work did it?  A fake load - that darn caching problem."

end
« Last Edit: October 02, 2014, 06:39:38 AM by prl »

DrollTroll

  • Kindly Curmudgeon
  • Administrator
  • *****
  • Posts: 4091
Re: Sample program highlighting DesignCAD name cache defect
« Reply #1 on: October 03, 2014, 02:57:44 PM »
I agree this is improper for "Load and explode" or "Load as original entities" settings (even if there's an embedded version of the original symbol or block). I'll have programming take a look.
2016 marks my 24th year in DesignCAD-Land!