Scale Point with Reference Point

Scale Point with Reference Point

SRSDS
Advisor Advisor
375 Views
1 Reply
Message 1 of 2

Scale Point with Reference Point

SRSDS
Advisor
Advisor

Is there a simple way to scale a point based on a reference point?

I would like to scale the vertices of a selected MLeader if the Cannoscale is changed.

 

A part of the problem is how to determine the scaling required based on the old and new Cannoscales.

 

Dim ml As MLeader = DirectCast(trans.GetObject(ObjID, OpenMode.ForWrite), MLeader)
Dim m_leaderLineIndex As Integer = 0
Dim pnt1 As Point3d = ml.GetFirstVertex(m_leaderLineIndex)
Dim pnt2 As Point3d = ml.GetLastVertex(m_leaderLineIndex)
'pnt2 = pnt2.scaleby(??,pnt1)
ml.SetLastVertex(m_leaderLineIndex, pnt2)

 

 

 

 

 

 

0 Likes
Accepted solutions (1)
376 Views
1 Reply
Reply (1)
Message 2 of 2

SRSDS
Advisor
Advisor
Accepted solution

Sorry, I think I worked it out

 

Dim CurrentScaleValue = db.Cannoscale.Scale 'Is the old Scale

Dim NewScaleValue = db.Cannoscale.Scale 'After it's changed

 

 

pnt2 = pnt2.ScaleBy(CurrentScaleValue / NewScaleValue, pnt1)

 

0 Likes