Message 1 of 2
Insert Problems

Not applicable
05-28-2001
11:25 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I had a problem with making this porgram work when in a UCS but then got the
TranslateCoordinates to work, which works fine.
However, once the leader is created in the drawing, it moves the distance
from the UCS to another point in relation to the WCS.
I suppose the leader is using the "dblPnts" as if they were in World, which
makes sense to the relational moving.
So how do I get the leader to be added in the current UCS using the points I
have already translated?
Thanks in advance,
Todd
Set objUtil = ThisDrawing.Utility
strPrompt = vbCrLf & "First Leader Point: "
With objUtil
varPnt = .GetPoint(, strPrompt)
pointUCS = .TranslateCoordinates(varPnt, acWorld, acUCS, False)
dblPnts(0) = pointUCS(0)
dblPnts(1) = pointUCS(1)
dblPnts(2) = pointUCS(2)
varPnt = .GetPoint(pointUCS, Prompt:="Second Leader Point:")
pointUCS = .TranslateCoordinates(varPnt, acWorld, acUCS, False)
dblPnts(3) = pointUCS(0)
dblPnts(4) = pointUCS(1)
dblPnts(5) = pointUCS(2)
varPnt = .GetPoint(pointUCS, Prompt:="Insertion point for annotation:")
pointUCS = .TranslateCoordinates(varPnt, acWorld, acUCS, False)
dblPnts(6) = pointUCS(0)
dblPnts(7) = pointUCS(1)
dblPnts(8) = pointUCS(2)
End With
Set AnnObject = Nothing
DirStr = "My.dwg"
If ThisDrawing.ActiveSpace = acModelSpace Then
Set objLeader = ThisDrawing.ModelSpace.AddLeader(dblPnts, AnnObject,
acLineWithArrow)
Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(pointUCS, DirStr,
1#, 1#, 0#)
Else
Set objLeader = ThisDrawing.PaperSpace.AddLeader(dblPnts, AnnObject,
acLineWithArrow)
Set blockRefObj = ThisDrawing.PaperSpace.InsertBlock(pointUCS, DirStr,
1#, 1#, 0#)
End If
TranslateCoordinates to work, which works fine.
However, once the leader is created in the drawing, it moves the distance
from the UCS to another point in relation to the WCS.
I suppose the leader is using the "dblPnts" as if they were in World, which
makes sense to the relational moving.
So how do I get the leader to be added in the current UCS using the points I
have already translated?
Thanks in advance,
Todd
Set objUtil = ThisDrawing.Utility
strPrompt = vbCrLf & "First Leader Point: "
With objUtil
varPnt = .GetPoint(, strPrompt)
pointUCS = .TranslateCoordinates(varPnt, acWorld, acUCS, False)
dblPnts(0) = pointUCS(0)
dblPnts(1) = pointUCS(1)
dblPnts(2) = pointUCS(2)
varPnt = .GetPoint(pointUCS, Prompt:="Second Leader Point:")
pointUCS = .TranslateCoordinates(varPnt, acWorld, acUCS, False)
dblPnts(3) = pointUCS(0)
dblPnts(4) = pointUCS(1)
dblPnts(5) = pointUCS(2)
varPnt = .GetPoint(pointUCS, Prompt:="Insertion point for annotation:")
pointUCS = .TranslateCoordinates(varPnt, acWorld, acUCS, False)
dblPnts(6) = pointUCS(0)
dblPnts(7) = pointUCS(1)
dblPnts(8) = pointUCS(2)
End With
Set AnnObject = Nothing
DirStr = "My.dwg"
If ThisDrawing.ActiveSpace = acModelSpace Then
Set objLeader = ThisDrawing.ModelSpace.AddLeader(dblPnts, AnnObject,
acLineWithArrow)
Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(pointUCS, DirStr,
1#, 1#, 0#)
Else
Set objLeader = ThisDrawing.PaperSpace.AddLeader(dblPnts, AnnObject,
acLineWithArrow)
Set blockRefObj = ThisDrawing.PaperSpace.InsertBlock(pointUCS, DirStr,
1#, 1#, 0#)
End If