draw a line and change the view

draw a line and change the view

Anonymous
Not applicable
247 Views
4 Replies
Message 1 of 5

draw a line and change the view

Anonymous
Not applicable
Hello,

I've made a sub to draw a line in vba:

Sub lijn(ByVal x1 As Double, ByVal y1 As Double, ByVal x2 As Double, ByVal y2 As Double, z As Double)
Dim beginpnt(0 To 2) As Double
Dim eindpnt(0 To 2) As Double
Dim lijn As AcadLine
Dim currThickness As Double

beginpnt(0) = x1: eindpnt(0) = x2
beginpnt(1) = y1: eindpnt(1) = y2
beginpnt(2) = 0: eindpnt(2) = 0

Set lijn = ThisDrawing.ModelSpace.AddLine(beginpnt, eindpnt)
lijn.Thickness = z
lijn.Update
End sub 'End of sub lijn

When I use it in top view everything works fine:

sub draw_line
bassTekenen.lijn 0, 150, 0, 200, 0
end sub 'End of draw line

But when I switch to front view the line appears as a dot.
My question is how I should programme the view switch?


Thanks
Steve
0 Likes
248 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
> But when I switch to front view the line appears as a dot. > My question is how I should programme the view switch? > > > Thanks > Steve What do you expect to see? A line in the Y axis that has 0 thickness will appear as a dot in the "front" view. A line in the X axis that has 0 thickness will appear the same in "top" & "front" views. Jeff
0 Likes
Message 3 of 5

Anonymous
Not applicable
Sorry jeff
I think I did not explain myself very well.

After changing to front view I run my macro again.

Steve
Message was edited by: steve mangelschots
0 Likes
Message 4 of 5

Anonymous
Not applicable
Sorry, Look at the "TranslateCoordinates" method and UCS's HTH, Jeff "steve mangelschots" wrote in message news:12287558.1081196630688.JavaMail.javamailuser@localhost... > Sorry > I think I did not explain myself very well. > > After changing to front view I run my macro again.
0 Likes
Message 5 of 5

Anonymous
Not applicable
Steve, please disregard my last post. I meant to suggest the "TransformBy" method. You also might want to look at the "GetUCSMatrix" method. Jeff "Jeff Mishler" wrote in message news:4071cba0$1_2@newsprd01... > Sorry, > Look at the "TranslateCoordinates" method and UCS's > > HTH, > Jeff > > "steve mangelschots" wrote in message > news:12287558.1081196630688.JavaMail.javamailuser@localhost... > > Sorry > > I think I did not explain myself very well. > > > > After changing to front view I run my macro again. > >
0 Likes