InstanceDefinitionTableCreateFromFile Method (String, String, String, String, String, InstanceDefinitionUpdateType, InstanceDefinitionLayerStyle, InstanceDefinitionNameConflictResolution, Boolean) |
Creates an instance definition by reading a file, the way the Insert command does when
inserting a file as a block. No instance reference is created.
Namespace:
Rhino.DocObjects.Tables
Assembly:
RhinoCommon (in RhinoCommon.dll)
Since: 9.0
Syntaxpublic int CreateFromFile(
string filename,
string name,
string description,
string url,
string urlTag,
InstanceDefinitionUpdateType updateType,
InstanceDefinitionLayerStyle layerStyle,
InstanceDefinitionNameConflictResolution conflictResolution,
bool skipNestedLinkedDefinitions
)
Public Function CreateFromFile (
filename As String,
name As String,
description As String,
url As String,
urlTag As String,
updateType As InstanceDefinitionUpdateType,
layerStyle As InstanceDefinitionLayerStyle,
conflictResolution As InstanceDefinitionNameConflictResolution,
skipNestedLinkedDefinitions As Boolean
) As Integer
Parameters
- filename
- Type: SystemString
The name of the file to read. This can be any type of file that Rhino or a plug-in can read.
- name
- Type: SystemString
The name of the instance definition to create. This must be a valid name. - description
- Type: SystemString
The description of the instance definition. If null or empty, then the notes of the file
being read, if any, are used.
- url
- Type: SystemString
The URL of the instance definition. If null or empty, then the model URL of the file
being read, if any, is used.
- urlTag
- Type: SystemString
The URL description, or hyperlink text, of the instance definition. If null or empty,
then the model URL of the file being read, if any, is used.
- updateType
- Type: Rhino.DocObjectsInstanceDefinitionUpdateType
The type of instance definition to create. - layerStyle
- Type: Rhino.DocObjectsInstanceDefinitionLayerStyle
How layers from the file appear in the model.
This is used only when updateType is InstanceDefinitionUpdateType.Linked.
- conflictResolution
- Type: Rhino.DocObjectsInstanceDefinitionNameConflictResolution
What to do when the model already contains an instance definition named name.
- skipNestedLinkedDefinitions
- Type: SystemBoolean
If true, then linked instance definitions nested in the file are not read.
Return Value
Type:
Int32
The index of the new instance definition, or the index of an existing linked instance
definition that already references filename. -1 on error.
See Also