Insert Problems

Insert Problems

Anonymous
Not applicable
192 Views
1 Reply
Message 1 of 2

Insert Problems

Anonymous
Not applicable
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
0 Likes
193 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Todd, although you need the translated points for the getpoint method, I
don't believe you need them to place the leader. Where you set your dblPnts,
set them to varPnt(0), varPnt(1) etc... I *think* that will fix you up.

Regards,
Jacob Dinardi



Todd Queen wrote in message
news:D9F65BD4D892FAFD8E00644C556660D5@in.WebX.maYIadrTaRb...
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
0 Likes