Message 1 of 4
dragmode blocks while inserting in VB
Not applicable
05-20-2002
10:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm trying to insert a block in VB6 and want to pass XYZ scale factors to
it. The problem I'm having is that I'm using "Getpoint" for insertion point
and then the "Sendcommand" to insert the block. This works, but this method
will not allow the block to be in "Dragmode" before insertion point is
picked (like AutoCAD's normal insert command). Any ideas on how I can
resolve this?
'------example code------------
Dim blkpnt2 As Variant
Dim UCSPnt As Variant
blkpnt2 = acadDoc.Utility.GetPoint(, "Specify insertion point: ")
'forced to specify insertion point first, therfore not allowing the block to
drag
UCSPnt = acadDoc.Utility.TranslateCoordinates(blkpnt2, acWorld, acUCS,
False)
xs = xscale.Text 'custom scale setting based on block
ys = yscale.Text 'custom scale varies with block
zs = 1
acadDoc.SendCommand ".-insert" & vbCr & TESTBLOCK & vbCr & UCSPnt(0) & "," &
UCSPnt(1) & "," & UCSPnt(2) & vbCr & "XYZ" & vbCr & xs & vbCr & ys & vbCr &
zs & vbCr
'because I have to use GetPoint and TranslateCoordinates for insertion
point, I do not have the abilityt to show the block being dragged before
insertion point....
Thanks in advance!
I'm trying to insert a block in VB6 and want to pass XYZ scale factors to
it. The problem I'm having is that I'm using "Getpoint" for insertion point
and then the "Sendcommand" to insert the block. This works, but this method
will not allow the block to be in "Dragmode" before insertion point is
picked (like AutoCAD's normal insert command). Any ideas on how I can
resolve this?
'------example code------------
Dim blkpnt2 As Variant
Dim UCSPnt As Variant
blkpnt2 = acadDoc.Utility.GetPoint(, "Specify insertion point: ")
'forced to specify insertion point first, therfore not allowing the block to
drag
UCSPnt = acadDoc.Utility.TranslateCoordinates(blkpnt2, acWorld, acUCS,
False)
xs = xscale.Text 'custom scale setting based on block
ys = yscale.Text 'custom scale varies with block
zs = 1
acadDoc.SendCommand ".-insert" & vbCr & TESTBLOCK & vbCr & UCSPnt(0) & "," &
UCSPnt(1) & "," & UCSPnt(2) & vbCr & "XYZ" & vbCr & xs & vbCr & ys & vbCr &
zs & vbCr
'because I have to use GetPoint and TranslateCoordinates for insertion
point, I do not have the abilityt to show the block being dragged before
insertion point....
Thanks in advance!