Hide Table of Contents
PromptForBlockInsertion Method (ICommandMessage)
Result[out]
Status of the input for inserting the Block instance as defined in dsPromptResultType_e

Prompts the user for the insertion point, scale factors, and rotation angle to use when inserting a Block Instance.

.NET Syntax

Visual Basic (Declaration) 
Function PromptForBlockInsertion( _
   const dsString& PreviewBlockName As System.String, _
   bool SpecifyScale As System.Boolean, _
   double DefaultScaleX As System.Double, _
   double DefaultScaleY As System.Double, _
   double DefaultScaleZ As System.Double, _
   bool SpecifyRotation As System.Boolean, _
   double DefaultRotation As System.Double, _
   double* X As System.Double, _
   double* Y As System.Double, _
   double* Z As System.Double, _
   double* ScaleX As System.Double, _
   double* ScaleY As System.Double, _
   double* ScaleZ As System.Double, _
   double* Rotation As System.Double _
) As dsPromptResultType_e
C# 
dsPromptResultType_e PromptForBlockInsertion( 
   System.string PreviewBlockName,
   System.bool SpecifyScale,
   System.double DefaultScaleX,
   System.double DefaultScaleY,
   System.double DefaultScaleZ,
   System.bool SpecifyRotation,
   System.double DefaultRotation,
   out System.double X,
   out System.double Y,
   out System.double Z,
   out System.double ScaleX,
   out System.double ScaleY,
   out System.double ScaleZ,
   out System.double Rotation
)
JavaScript 
PromptForBlockInsertion( 
   PreviewBlockName : String,
   SpecifyScale : Boolean,
   DefaultScaleX : Number,
   DefaultScaleY : Number,
   DefaultScaleZ : Number,
   SpecifyRotation : Boolean,
   DefaultRotation : Number
) : {
   X : Number,
   Y : Number,
   Z : Number,
   ScaleX : Number,
   ScaleY : Number,
   ScaleZ : Number,
   Rotation : Number,
   Result : String
}
COM native C++ 
HRESULT PromptForBlockInsertion( 
   BSTR PreviewBlockName,
   VARIANT_BOOL SpecifyScale,
   DOUBLE DefaultScaleX,
   DOUBLE DefaultScaleY,
   DOUBLE DefaultScaleZ,
   VARIANT_BOOL SpecifyRotation,
   DOUBLE DefaultRotation,
   DOUBLE* X,
   DOUBLE* Y,
   DOUBLE* Z,
   DOUBLE* ScaleX,
   DOUBLE* ScaleY,
   DOUBLE* ScaleZ,
   DOUBLE* Rotation,
   dsPromptResultType_e* Result
) 
C++ 
DSRESULT PromptForBlockInsertion( 
   const dsString& PreviewBlockName,
   bool SpecifyScale,
   double DefaultScaleX,
   double DefaultScaleY,
   double DefaultScaleZ,
   bool SpecifyRotation,
   double DefaultRotation,
   double* X,
   double* Y,
   double* Z,
   double* ScaleX,
   double* ScaleY,
   double* ScaleZ,
   double* Rotation,
   dsPromptResultType_e* Result
) 

Parameters

PreviewBlockName
Name of the Block definition to insert to create the Block instance
SpecifyScale
True to use the values specified for DefaultScaleX, DefaultScaleY, and DefaultScaleZ for the Block instance's scale factors, false to use the user-interactive values (see Remarks)
DefaultScaleX
Scale factor for the x axis for the Block instance if SpecifyScale is set to true (see Remarks)
DefaultScaleY
Scale factor for the y axis for the Block instance if SpecifyScale is set to true (see Remarks)
DefaultScaleZ
Scale factor for the z axis for the Block instance if SpecifyScale is set to true (see Remarks)
SpecifyRotation

True to use the value specified for DefaultRotation for the Block instance's rotation angle, false to use the user-interactive value (see Remarks)

DefaultRotation
Angle, in radians, by which to rotate the Block instance if SpecifyRotation is set to true (see Remarks)
X[out]
x coordinate where to insert the Block instance
Y[out]
y coordinate where to insert the Block instance
Z[out]
z coordinate where to insert the Block instance
ScaleX[out]
Scale factor for the x axis of the Block instance
ScaleY[out]
Scale factor for the y axis of the Block instance
ScaleZ[out]
Scale factor for the z axis of the Block instance
Rotation[out]
Angle, in radians, by which to rotate the Block instance
Result[out] or Return Value
Status of the input for inserting the Block instance as defined in dsPromptResultType_e

Example

Remarks

If this parameter... Is set to... Then...
SpecifyScale True The DefaultScaleX, DefaultScaleY, and DefaultScaleZ values are used to scale the Block instance when the user presses the Enter key when prompted for these values in the command window.
False Either the values typed in the command window, or the coordinates that correspond to the point where the user clicks in the graphics area, are used to scale the Block instance.
SpecifyRotation True

The DefaultRotation value is used for the rotation angle of the Block instance when the user presses the Enter key when prompted for this value in the command window.

False Either the value typed in the command window, or the angle that corresponds to the point where the user clicks in the graphics area, is used for the rotation angle of the Block instance.

NOTE: A positive value for the rotation angle rotates the Block instance counterclockwise, and a negative value rotates the Block instance clockwise.

Typical use of this method involves:

  1. Defining the Block definition using IDocument::CreateBlockDefinition, if needed. If a Block definition already exists, skip this step.
  2. Defining how to insert the Block using ICommandMessage::PromptForBlockInsertion.
  3. Inserting the Block using ISketchManager::InsertBlock2 and the output values of ICommandMessage::PromptForBlockInsertion. 
 

See Also

Availability

DraftSight V1R3.1


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:   PromptForBlockInsertion Method (ICommandMessage)
*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) 2019 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.