Is there a way to pre-set XFM option for saving DGN charts to different value?

Hello everyone, I have a question:

Lets say I'm trying to save DGN. Save As dialog is opened and you can see the possibillity to tinker with the Options. Is there a way to prepare settings that will be put into the current Options?

Screenshot example:

This is the default XFM value. However, I would like it to be 

by default. Is there a way to achieve that(lets say from code - or are there other options to preset it from different place)? Thanks for any answers

Parents Reply Children
  • This code was offered by the Map Programming staff, and is available in the Map SDK documentation:
    ---

    FeatureInstanceConvertModeDuringFileSaveAs

    Summary

    Read/Write FeatureInstanceConvertMode value specifying the feature instances that are converted during "Design File Save As" processing.

    Default value is featureInstanceConvertModePreserveXFMData.

    Syntax

    object.FeatureInstanceConvertModeDuringFileSaveAs [=FeatureInstanceConvertMode]

    Part

    Description

    object

    A valid FeatureMgr object

    FeatureInstanceConvertMode

    A FeatureInstanceConvertMode expression.


    Example

    Example
    ' Save current state
    Dim currentConvertMode As FeatureInstanceConvertMode
    Dim currentApplyFeatureInferenceRulesDuringFileSaveAs As Boolean
    Dim currentApplyLegacyDFSRulesDuringFileSaveAs As Boolean

    currentConvertMode = xft.FeatureMgr.FeatureInstanceConvertModeDuringFileSaveAs
    currentApplyFeatureInferenceRulesDuringFileSaveAs = xft.FeatureMgr.ApplyFeatureInferenceRulesDuringFileSaveAs
    currentApplyLegacyDFSRulesDuringFileSaveAs = xft.FeatureMgr.ApplyLegacyDFSRulesDuringFileSaveAs

    ' Enable feature instance conversion during File Save As processing
    xft.FeatureMgr.FeatureInstanceConvertModeDuringFileSaveAs = FeatureInstanceConvertMode.featureInstanceConvertModeXFMV1ToV2

    xft.FeatureMgr.ApplyFeatureInferenceRulesDuringFileSaveAs = False
    xft.FeatureMgr.ApplyLegacyDFSRulesDuringFileSaveAs = False

    ActiveDesignFile.SaveAs "c:\temp\newfile.dgn", True, msdDesignFileFormatV8

    ' Reset feature instance conversion state
    xft.FeatureMgr.FeatureInstanceConvertModeDuringFileSaveAs = currentConvertMode
    xft.FeatureMgr.ApplyFeatureInferenceRulesDuringFileSaveAs = currentApplyFeatureInferenceRulesDuringFileSaveAs
    xft.FeatureMgr.ApplyLegacyDFSRulesDuringFileSaveAs = currentApplyLegacyDFSRulesDuringFileSaveAs

    ---

    xfmSystem_setFeatureInstanceConvertModeDuringFileSaveAs

    Summary

    Sets conversion mode value specifying the feature instances that are converted during "Design File Save As" processing.

    Default value is XFMFEATUREINSTANCECONVERTMODE_PreserveXFMData.

    See Also:

    xfmSystem_getFeatureInstanceConvertModeDuringFileSaveAs.

    FunctionPublished XfmFeatureInstanceConvertMode xfmSystem_setFeatureInstanceConvertModeDuringFileSaveAs(XfmFeatureInstanceConvertMode convertMode)

    Required Header

    <xfmApi.fdf>

    Required Library

    xfmApi.dlo for MDL source
    xfmApi.lib for C source

    Return Value

    Returns XfmFeatureInstanceConvertMode value specifying the previous state of this setting.

    Parameters

    Item

    Description

    convertMode

    XfmFeatureInstanceConvertMode value.

    Example

        XfmFeatureInstanceConvertMode currentConvertMode = XFMFEATUREINSTANCECONVERTMODE_XFMV1ToV2;    xfmSystem_setFeatureInstanceConvertModeDuringFileSaveAs(currentConvertMode);

     



  • You can also use a key-in to set the option "Remove OpenCities Map Specific Data": 
    calculator gXfmSaveAsConvertOptions.convertMode=3

    Next open the Save As dialog with the keyin: Save As v8

    Answer Verified By: Lubo B 

  • Thanks for help, both of you. Im glad that there were such functions available. At the end of the day I have decided to use it with calling built in keyin.