Click or drag to resize

InstanceDefinitionTableCreateFromFile Method (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
Syntax
public int CreateFromFile(
	string filename,
	string name,
	InstanceDefinitionUpdateType updateType,
	InstanceDefinitionLayerStyle layerStyle,
	InstanceDefinitionNameConflictResolution conflictResolution,
	bool skipNestedLinkedDefinitions
)

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.
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