60002104 Ability to pass filename or block name point and scale to the cmdInsert dialog

Article 60002104
Type Wish
Product Engine
Version 6027
Date Added 12/19/2013 12:00:00 AM
Fixed (1/29/2014 12:00:00 AM)
Submitted by Mario Pelegrino

Summary

Is it possible to o pass filename or block name point and scale to the cmdInsert dialog ? I am using the VDF Wrapper component (vdraw.ocx)

Solution

In version 6028 we exported a new command at the commandaction of the vdDocument object like below

summary: Opens a dialog for selecting and inserting a block in the document used to initialize the insert dialog with the passed parameters.
"mblockname": a filename if it is an xref or a blockname or "user" so the dialog is not initialised.
"isxref": A boolean value if the passed filename is an xref or not.
"mInsertionpoint": A double[] with 3 doubles representing the insertion point OR "user" so the dialog is not initialised.
"mscales": A double[] with 3 doubles representing the scales OR "user" so the dialog is not initialised.
"mrotation": A double value representing the rotation OR "user" so the dialog is not initialised.
returns: True if the command was succesfull.
public bool CmdInsertBlockDialog(string mblockname, bool isxref, object mInsertionpoint, object mscales, object mrotation)

You can use this method like below:

In c# :
   vdFramedControl.BaseControl.ActiveDocument.CommandAction.CmdInsertBlockDialog("c:\\test.vdml", true , "user", "user", 90.0);
   vdFramedControl.BaseControl.ActiveDocument.CommandAction.CmdInsertBlockDialog("VDDIM_NONE", false , "user", "user",90.0);



And in the VDF wrapper (vdraw.ocx):

  Dim vddoc As VectorDraw_Professional.vdDocument 
  Dim scales(2) As Double
  Dim InsPT(2) As Double
 
      Set vddoc = VDraw.ActiveDocument.WrapperObject 
 
      scales(0) = 3#
      scales(1) = 3#
      scales(2) = 1#

      scales(0) = 5
      scales(1) = 4
      scales(2) = 2

      vddoc.CommandAction.CmdInsertBlockDialog_2 "VDDIM_DEFAULT", False, "user", scales, CDbl(90.0)
      vddoc.CommandAction.CmdInsertBlockDialog_2 "c:\test\mydrawing1.dwg", True, InsPT, scales, CDbl(90.0)

Send comments on this topic.