In a function I wrote, I need to copy element from a workdgn to another work dgn. When I open the file where elements have been copied, element color are altered. For example, color 22 in the first workdgn becomes 6 in the destination, color 34 becomes 58... I can't find a rule...
Some remarks :
Source and destination workdgn will be opened and processed like this :
// we create the destinationif( mdlWorkDgn_createFile( &pModelRefDest,
chFichierTemp, DGNFILE_FORMAT_V8, pModelRefSeed, SEED_CopyDefaultData, NULL, NULL, bThreeD ) != SUCCESS )
{
// we open the source fileif( mdlWorkDgn_openFile( &pModelRefSource, NULL, NULL, chTempFilename, NULL, TRUE ) == SUCCESS ){
CopyContextP pCC = mdlCopyContext_create(); // a copycontext is created
// we have here a scanner to find elements to copy
// for each element corresponding to the scan criteria, we do:
// element color is correct (pElmdscr->el.hdr.dhdr.symb.color)
if( mdlElmdscr_copy( &pElmdscr, pModelRefSource, pModelRefDest, pCopyContext ) == SUCCESS ) {
// pElmdscr->el.hdr.dhdr.symb.color is different
}
mdlWorkDgn_closeFile( pModelRefSource );
mdlCopyContext_free( &pCopyContext ); // copycontext is freed
mdlWorkDgn_closeFile( pModelRefDest );
In the MDL help file, for the function mdlElmdscr_copy, we found this description for the parameter "elDscrPP :
I agree with the sentence in red for levels or linestyle. For the color I don't know if it applies ?
My question is : Anybody has encountered this kind of issue ? There is a way to solve it ?
Many thanks in advance.
Philippe
Michael Stark said:but maybe worth a try.
Philippe HALET
CEO at beCAD a Gold Channel Partner
Unknown said:I you want, I can send you the files I use...
Sure, I'll have a quick look at what the copy code is doing if you want to attach them.
-B