Jump to content

Find perpendicular as endpoint for dimension


priyanka_mehta

Recommended Posts

Hi all,

I need to create an aligned dimension. The startpoint for this dimension could be anywhere on polyline/arc/line etc.. but the endpoint for this is perpendicular from the start point.

 

I tried this code, but later realized getpoint cannot find relatively perpendicular points.

 

Dim dimStyle As AcadDimStyle
Dim dimObj As AcadDimAligned
Dim Point1 As Variant
Dim Point2 As Variant
Dim Loc(0 To 2) As Double

Set dimStyle = ThisDrawing.DimStyles.Add("MyDim")

Point1 = ThisDrawing.Utility.GetPoint(, "Pick Point 1: ")
Point2 = ThisDrawing.Utility.GetPoint(, "Pick Point 2: ")
x = (Point1(0) + Point2(0)) / 2
y = (Point1(1) + Point2(1)) / 2

Loc(0) = x
Loc(1) = y
Loc(2) = 0
Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(Point1, Point2, Loc)

 

Thanks in advance,

Priyanka

Link to comment
Share on other sites

How about this:

 

Point1 = ThisDrawing.Utility.GetPoint(, "Pick Point 1: ")
ThisDrawing.SetVariable "LastPoint", Point1
Point2 = ThisDrawing.Utility.GetPoint(, "Pick Point 2: ")

Link to comment
Share on other sites

Hey thanks a lot Seant,

 

I tried your line of code and somehow got to this idea too.

 

Point1 = ThisDrawing.Utility.GetPoint(,"Pick Point 1: ")

Point2 = ThisDrawing.Utility.GetPoint(Point1 ,"Pick Point 2: ")

 

 

 

Thanks a lot,

Regards,

Priyanka

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...