Hide Table of Contents
InsertAttributeDefinition2 Method (ISketchManager)
AttributeDefinition[out]
IAttributeDefinition

Creates a BlockAttribute definition.

.NET Syntax

Visual Basic (Declaration) 
Function InsertAttributeDefinition2( _
   const dsString& Name As System.String, _
   const dsString& Caption As System.String, _
   const dsString& DefaultValue As System.String, _
   double PositionX As System.Double, _
   double PositionY As System.Double, _
   double PositionZ As System.Double, _
   const dsString& TextStyle As System.String, _
   dsTextJustification_e Justification As dsTextJustification_e, _
   double Height As System.Double, _
   double Rotation As System.Double, _
   bool Fixed As System.Boolean, _
   bool Hidden As System.Boolean, _
   bool Predefined As System.Boolean, _
   bool Validate As System.Boolean, _
   bool LockInBlock As System.Boolean, _
   bool PositionBelowLastDefinition As System.Boolean, _
   bool Multilines As System.Boolean _
) As AttributeDefinition
C# 
AttributeDefinition InsertAttributeDefinition2( 
   System.string Name,
   System.string Caption,
   System.string DefaultValue,
   System.double PositionX,
   System.double PositionY,
   System.double PositionZ,
   System.string TextStyle,
   dsTextJustification_e Justification,
   System.double Height,
   System.double Rotation,
   System.bool Fixed,
   System.bool Hidden,
   System.bool Predefined,
   System.bool Validate,
   System.bool LockInBlock,
   System.bool PositionBelowLastDefinition,
   System.bool Multilines
)
JavaScript 
InsertAttributeDefinition2( 
   Name : String,
   Caption : String,
   DefaultValue : String,
   PositionX : Number,
   PositionY : Number,
   PositionZ : Number,
   TextStyle : String,
   Justification : String,
   Height : Number,
   Rotation : Number,
   Fixed : Boolean,
   Hidden : Boolean,
   Predefined : Boolean,
   Validate : Boolean,
   LockInBlock : Boolean,
   PositionBelowLastDefinition : Boolean,
   Multilines : Boolean
) : dsAttributeDefinition
COM native C++ 
HRESULT InsertAttributeDefinition2( 
   BSTR Name,
   BSTR Caption,
   BSTR DefaultValue,
   DOUBLE PositionX,
   DOUBLE PositionY,
   DOUBLE PositionZ,
   BSTR TextStyle,
   dsTextJustification_e Justification,
   DOUBLE Height,
   DOUBLE Rotation,
   VARIANT_BOOL Fixed,
   VARIANT_BOOL Hidden,
   VARIANT_BOOL Predefined,
   VARIANT_BOOL Validate,
   VARIANT_BOOL LockInBlock,
   VARIANT_BOOL PositionBelowLastDefinition,
   VARIANT_BOOL Multilines,
   IAttributeDefinition** AttributeDefinition
) 
C++ 
DSRESULT InsertAttributeDefinition2( 
   const dsString& Name,
   const dsString& Caption,
   const dsString& DefaultValue,
   double PositionX,
   double PositionY,
   double PositionZ,
   const dsString& TextStyle,
   dsTextJustification_e Justification,
   double Height,
   double Rotation,
   bool Fixed,
   bool Hidden,
   bool Predefined,
   bool Validate,
   bool LockInBlock,
   bool PositionBelowLastDefinition,
   bool Multilines,
   dsAttributeDefinition** AttributeDefinition
) 

Parameters

Name
Name of the BlockAttribute
Caption
Text that displays at the command window during Block insertion
DefaultValue
Visible component of the BlockAttribute
PositionX
x coordinate for the insertion point of the BlockAttribute
PositionY
y coordinate for the insertion point of the BlockAttribute
PositionZ
z coordinate for the insertion point of the BlockAttribute
TextStyle
Text style of the BlockAttribute
Justification
Position and alignment of the BlockAttribute text in relation to the insertion point
Height
Text size of the BlockAttribute
Rotation
Insertion angle of the BlockAttribute
Fixed
True to make the default value of the BlockAttribute a constant value, false to make it a variable value
Hidden
True to hide the BlockAttribute in Block references, false to show it
Predefined
True to use the default values, false to request a value
Validate
True to prompt the user for verification that the BlockAttribute value is correct when inserting a Block, false to not
LockInBlock
True to lock the BlockAttribute within the Block reference, false to not
PositionBelowLastDefinition
True to align the current BlockAttribute below the previous one, false to not (see Remarks)
Multilines
True if the BlockAttribute is multiline, false if single line (see Remarks)
AttributeDefinition[out] or Return Value
IAttributeDefinition

Remarks

The difference between this method and the now obsolete ISketchManager::InsertAttributeDefinition is that this method's Multilines parameter allows you to create a multiline BlockAttribute. You cannot change a BlockAttribute from single line to multiline, or vice versa, after creation.

The PositionBelowLastDefinition parameter is ignored when the entity is created in temporary mode.

 

See Also

Availability

DraftSight 2018 SP0


Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   InsertAttributeDefinition2 Method (ISketchManager)
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:

x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2022 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.