Ok, this is a long post, but it is everything I have so far.
First code to draw a rectangle (works fine):
Private Sub Tester_Click()
pi = 3.14159265358979
ptLenI = 39
ptWidI = 27
TitleBlock.Hide
pt1 = ThisDrawing.Utility.GetPoint(, "Pick lower left edge:")
'ptR = ThisDrawing.Utility.GetPoint(, "Pick right edge:")
pt2 = ThisDrawing.Utility.PolarPoint(pt1, 0, ptLenI)
pt3 = ThisDrawing.Utility.PolarPoint(pt2, pi / 2, ptWidI)
pt4 = ThisDrawing.Utility.PolPrivate Sub Tester_Click()
pi = 3.14159265358979
ptLenI = 39
ptWidI = 27
TitleBlock.Hide
pt1 = ThisDrawing.Utility.GetPoint(, "Pick lower left edge:")
'ptR = ThisDrawing.Utility.GetPoint(, "Pick right edge:")
pt2 = ThisDrawing.Utility.PolarPoint(pt1, 0, ptLenI)
pt3 = ThisDrawing.Utility.PolarPoint(pt2, pi / 2, ptWidI)
pt4 = ThisDrawing.Utility.PolarPoint(pt1, pi / 2, ptWidI)
'pt4 = ThisDrawing.Utility.PolarPoint(pt1, pi / 2, ptWidI)
ThisDrawing.ModelSpace.AddLine pt1, pt2
ThisDrawing.ModelSpace.AddLine pt2, pt3
ThisDrawing.ModelSpace.AddLine pt3, pt4
ThisDrawing.ModelSpace.AddLine pt4, pt1
'*** OUTER BORDER ********************************************
TitleBlock.show
End Sub
arPoint(pt1, pi / 2, ptWidI)
'pt4 = ThisDrawing.Utility.PolarPoint(pt1, pi / 2, ptWidI)
ThisDrawing.ModelSpace.AddLine pt1, pt2
ThisDrawing.ModelSpace.AddLine pt2, pt3
ThisDrawing.ModelSpace.AddLine pt3, pt4
ThisDrawing.ModelSpace.AddLine pt4, pt1
'*** OUTER BORDER ********************************************
TitleBlock.show
End SubAdded to General:
Sub CreateLine()
Dim StartPoint(0 To 2) As Double
Dim EndPoint(0 To 2) As Double
Dim txtStartPointX = 5.00
Dim txtStartPointY = 28.00
Dim txtStartPointZ = 0.00
Dim txtEndPointX = 5.00
Dim txtStartPointY = 27.50
Dim txtStartPointZ = 0.00
StartPoint(0) = txtStartPointX
StartPoint(1) = txtStartPointY
StartPoint(2) = txtStartPointZ
EndPoint(0) = txtEndPointX
EndPoint(1) = txtEndPointY
EndPoint(2) = txtEndPointZ
With ThisDrawing.ModelSpace
.AddLine StartPoint, EndPoint
.Item(.Count - 1).Update
End SubAdded to second Button:
Private Sub CommandButton1_Click()
CreateLine
End Sub
Looking to type in an entire list of these coordinates for line generation. As shown in the screenshot also, various parts of the title block will have justified text (contents controlled by the dialogue box). The text content generation is no issue, only the placement. ' This is sourced information, not my own.
Sub Example_AddMtext()
' This example creates an MText object in model space.
Dim MTextObj As AcadMText
Dim corner(0 To 2) As Double
Dim width As Double
Dim text As String
corner(0) = 0#: corner(1) = 10#: corner(2) = 0#
width = 10
text = "This is the text String for the mtext Object"
' Creates the mtext Object
Set MTextObj = ThisDrawing.ModelSpace.AddMText(corner, width, text)
ZoomAll
End Sub