Functions
Line Style Names

Functions

StringListP mdlLineStyle_nameGetStringList (WCharCP pAuxInfo, int options)
 Create a string list containing all line style names from the active resource name map. More...
 
StatusInt mdlLineStyle_nameModify (WCharCP pNewName, RscFileHandle newRscFile, UInt32 newType, DgnPlatform::ElementId newID, UInt32 newAttributes, WCharCP pOldName, UInt32 option)
 Modify the information in the active design file name maps. More...
 
StatusInt mdlLineStyle_nameInsert (WCharCP styleName, UInt32 rscFile, DgnPlatform::LsResourceType rscType, DgnPlatform::ElementId rscID, UInt32 nameAttributes, UInt32 option)
 Insert an entry into the active line style name map. More...
 
StatusInt mdlLineStyle_nameDelete (WCharCP pStyleName, long option)
 Removes an entry from the active line style name map. More...
 
int mdlLineStyle_nameQuery (DgnPlatform::LineStyleNameInfo *pNameInfo, WCharCP pStyleName, DgnModelRefP modelRef, UInt32 option)
 Get the resource information from the active line style name map entry for pStyleName. More...
 
int mdlLineStyle_nameLoadMap (DgnModelRefP modelRef, UInt32 option)
 Load the line style name map(s) from the specified file(s) into the active line style name maps. More...
 
int mdlLineStyle_nameSaveMap (DgnModelRefP modelRef, UInt32 option)
 Store the active line style name maps in a design file. More...
 

Detailed Description

Function Documentation

StatusInt mdlLineStyle_nameDelete ( WCharCP  pStyleName,
long  option 
)

Removes an entry from the active line style name map.

Once removed the line style name is no longer available to MicroStation or any line style functions.

Parameters
[in]pStyleNamethe line style name that is to be removed from the active line style name map.
[in]optionset this to LSNAME_FREECOMPONENTS to free all components from the linestyle cache. Otherwise set it to 0.
Remarks
This function works directly on the active name maps. The changes are not written to file and will be lost unless the name maps are saved.
Returns
SUCCESS or a non-zero error status.
See also
mdlLineStyle_nameInsert mdlLineStyle_nameModify mdlLineStyle_nameQuery mdlLineStyle_nameLoadMap mdlLineStyle_nameSaveMap mdlLineStyle_nameGetStringList
StringListP mdlLineStyle_nameGetStringList ( WCharCP  pAuxInfo,
int  options 
)

Create a string list containing all line style names from the active resource name map.

By default, the string list will contain four info fields (per cell). The first info field will be left empty and should be reserved for use by the list box manager. The second, third and fourth info fields will contain the resource file handle, resource type and resource ID respectively, from the name map record. In DWG work mode, or if CAPABILITY_DWGINCOMPATIBLE_LINESTYLES is not enabled, this will only return line styles that can be exported to DWG.

Parameters
[in]pAuxInfoIf this parameter is not NULL, it should contain a regular expression that will be used to match the line style names.
[in]optionsSpecify which line styles are requested. If LSSL_OPT_RSCONLY is specified, then only line styles which appear in resource files will be listed. If LSSL_OPT_MASTONLY is specified, then only line styles that appear in the MASTERFILE will be returned. Typically this flag is 0 to get all styles.
Remarks
It is the responsibility of the caller to free the string list memory by calling mdlStringList_destroy.
Returns
The address of the new string list if successful. Otherwise the function returns NULL.
See also
mdlStringList_destroy
StatusInt mdlLineStyle_nameInsert ( WCharCP  styleName,
UInt32  rscFile,
DgnPlatform::LsResourceType  rscType,
DgnPlatform::ElementId  rscID,
UInt32  nameAttributes,
UInt32  option 
)

Insert an entry into the active line style name map.

Once inserted, the name is available for use by any line style operations.

Parameters
[in]styleNamethe address of the style name to be copied into the active line style name map.
[in]rscFileThe rscFile, rscType and rscID parameters define the resource file, type and ID respectively of the top level line style resource that will be referenced by pStyleName.
[in]rscTyperesource type
[in]rscIDresource ID
[in]nameAttributesattributes to associate with the style.
[in]optioncurrently unused. Pass 0 to guarantee compatibility with future versions.
Remarks
This function works directly on the active name maps. The changes are not written to file and will be lost unless the name maps are saved.
Returns
SUCCESS or a non-zero error status.
See also
mdlLineStyle_nameDelete mdlLineStyle_nameModify mdlLineStyle_nameQuery mdlLineStyle_nameLoadMap mdlLineStyle_nameSaveMap mdlLineStyle_nameGetStringList
int mdlLineStyle_nameLoadMap ( DgnModelRefP  modelRef,
UInt32  option 
)

Load the line style name map(s) from the specified file(s) into the active line style name maps.

Once completed, the names from the map are available for use by MicroStation and any line style functions.

Parameters
[in]modelRefIndicates the model from which the name map will be loaded. The maps for that model and all loaded references will be loaded.
[in]optionCurrently unused; 0 should be passed to guarantee compatibility with future versions.
Remarks
This function can be used to reload all name maps if an application has modified the resource file or design file name maps directly.
Returns
SUCCESS if the name map(s) were loaded successfully or a non-zero error status.
See also
mdlLineStyle_nameInsert mdlLineStyle_nameDelete mdlLineStyle_nameModify mdlLineStyle_nameQuery mdlLineStyle_nameSaveMap mdlLineStyle_nameGetStringList
StatusInt mdlLineStyle_nameModify ( WCharCP  pNewName,
RscFileHandle  newRscFile,
UInt32  newType,
DgnPlatform::ElementId  newID,
UInt32  newAttributes,
WCharCP  pOldName,
UInt32  option 
)

Modify the information in the active design file name maps.

This function searches the active resource name map for the record indicated by pOldName. If located, the record will contain the file, type, ID and attributes of the line style component referenced by pOldName. The remaining function parameters are used to alter the active name map record.

Parameters
[in]pNewNameIf the pNewName parameter is not NULL, the string it points to will be copied into the active resource name map in place of pOldName. If an entry for this name also exists in the active design file name map, it too will be modified and all elements using the associated style ID number will now reference the new style name.
[in]newRscFileIf the newRscFile parameter is not zero, it will replace the resource file handle stored in the located name map record.
[in]newTypeIf the newType parameter is not zero, it will replace the resource type stored in the located name map record.
[in]newIDIf the newID parameter is not zero, it will replace the resource ID stored in the located name map record.
[in]newAttributesnew name attributes.
[in]pOldNameexisting line style name.
[in]optionCurrently unused; always pass 0 to guarantee compatibility with future versions.
Remarks
It is important to note that this function cannot be replaced by similar calls to mdlLineStyle_nameInsert and mdlLineStyle_nameDelete. Deleting the old resource name map entry and then inserting the new one updates the data stored in the file, but does not update the in-memory design file name map and therefore does not guarantee the use of the same style ID number. This could in turn orphan any elements that use the affected line style.
This function works directly on the active name maps. The changes are not written to file and will be lost unless the name maps are saved.
Returns
SUCCESS if the modify operation is completed successfully. Otherwise, a non zero error status is returned.
See also
mdlLineStyle_nameInsert mdlLineStyle_nameDelete mdlLineStyle_nameQuery mdlLineStyle_nameLoadMap mdlLineStyle_nameSaveMap mdlLineStyle_nameGetStringList
int mdlLineStyle_nameQuery ( DgnPlatform::LineStyleNameInfo *  pNameInfo,
WCharCP  pStyleName,
DgnModelRefP  modelRef,
UInt32  option 
)

Get the resource information from the active line style name map entry for pStyleName.

Parameters
[out]pNameInfoThe values for the line style component resource file handle, resource type and resource ID are returned in pNameInfo. The DgnPlatform::LineStyleNameInfo structure is defined in mslstyle.h.
[in]pStyleNamerepresents the line style name map entry from which the resource information is to be extracted.
[in]modelRefused when option is LSQUERY_STYLEID to determine the id for the given modelRef.
[in]optionfunction options; Currently the option parameter can be 0 to find standard information or LSQUERY_STYLEID to look up the style id in the provided modelRef.
Returns
SUCCESS if the query operation was completed successfully. If the name does not exist in the line style name map, a non-zero error status is returned.
See also
mdlLineStyle_nameInsert mdlLineStyle_nameDelete mdlLineStyle_nameModify mdlLineStyle_nameLoadMap mdlLineStyle_nameSaveMap mdlLineStyle_nameGetStringList
int mdlLineStyle_nameSaveMap ( DgnModelRefP  modelRef,
UInt32  option 
)

Store the active line style name maps in a design file.

Parameters
[in]modelRefIdentifies the file in which the name map is to be stored.
[in]optionCurrently unused.
Returns
SUCCESS if the name map was stored successfully or a non-zero error status.
See also
mdlLineStyle_nameInsert mdlLineStyle_nameDelete mdlLineStyle_nameModify mdlLineStyle_nameQuery mdlLineStyle_nameLoadMap mdlLineStyle_nameGetStringList

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.