Page 1 of 1

SymRead questions (D4D)

PostPosted: Mon Mar 25, 2019 5:35 pm
by dhs
Hi,
I have some logic that is doing a SymRead and then creating some entities based on the symbol entities (but quite deliberately not actually adding any instance of the symbol to the drawing).
I am hoping that somebody can help me with a couple of questions:

  1. If I do multiple SymRead calls with different file names but using the same symname parameter (I was using something like 'Temp'), then it seems that the first symbol read is saved to the drawing file somehow and subsequent SymRead calls do not overwrite it (i.e. the subsequent SymRead calls do not work).
    Does anybody know if there is a way to delete the symbol that has already been read before the next SymRead call? (I've looked for a few variations, but cannot find a 'SymDel' (or similar) call in UInterfaces)
  2. To get around the above problem I am changing the symname parameter every time I call SymRead. This works fine, but assume I adding a whole lot of unused symbols to the drawing file somewhere, in which case should I be doing something to delete them (or will they be automatically deleted at some stage as they are not actually referenced anywhere) ? (if there is a 'SymDel' type procedure in answer to the first point then it also largely answers this question)

Thanks.
David H.

Re: SymRead questions (D4D)

PostPosted: Thu Apr 11, 2019 3:38 pm
by dhs
Just a note about this question. I haven't found any way to delete the 'unused' symbols from the file (or to overwrite them), and don't know if they will ever be automatically purged.

But I have realised that it is possible to prevent an untold number of symbols being added to the file. I am now basing the symname parameter on the actual file name: I am appending a timestamp to the filename and using that as the symname parameter (the timestamp is based on the last modified date/time of the file to ensure that I can read a new copy of the symbol if the file is modified).

Initially I was using something like 'temp' but it was not possible to overwrite the symbol that had been read in subsequent calls. I then changed to using a different symname every time I called SymRead (this works, but has the potential to add an untold number of symbols to the file - not ideal, but probably not a problem in these days of massive amounts of storage and memory).

Rgds,
David H.

Re: SymRead questions (D4D)

PostPosted: Thu Apr 11, 2019 3:57 pm
by joshhuggins
Hi David,

Users have the option in the DCADWIN.INI file to have unused symbols to be automatically purged from the drawing on exit, which I would think should work for ya. I would hope/recommend everyone use this to keep their files nice and speedy. Below are the related INI entries.
Code: Select all[General]
PurgeDrawingsOnExit=1

[Purge]
Symbols(Automatic)=True

Re: SymRead questions (D4D)

PostPosted: Thu Apr 11, 2019 4:35 pm
by dhs
Thanks Josh,

You have answered my initial question, but I will leave my logic as it is for those who don't have this option set (which may be quite a few, as my default install of Dcad has 'Symbols(Automatic)=FALSE' and also 'Symbols(Manual)=FALSE').

Rgds,
David H.