OSNAP only work when you call CaommandMethod, not work when is called from a internal VB function ...
Is there any way to make this work ? Was it changed in ICAD PE10 ?
Code: Select all
Protected Overrides Function Sampler(prompts As JigPrompts) As SamplerStatus
Try
Select Case mCurJigFactorIndex
Case 1
Dim prOptions1 As New JigPromptPointOptions
' Set properties such as UseBasePoint and BasePoint of the prompt options object if necessary here.
prOptions1.UserInputControls = UserInputControls.GovernedByOrthoMode Or UserInputControls.GovernedByUCSDetect Or
UserInputControls.Accept3dCoordinates Or UserInputControls.NullResponseAccepted
prOptions1.UseBasePoint = True
prOptions1.BasePoint = Base
prOptions1.UseRubberBand = False
prOptions1.Message = vbLf & "Mover>"
Dim prResult1 As PromptPointResult = prompts.AcquirePoint(prOptions1)
If prResult1.Status = PromptStatus.Keyword Then
Return SamplerStatus.OK
End If
If prResult1.Status = PromptStatus.Cancel Then
Location = Base
Return SamplerStatus.Cancel
End If
If Base.DistanceTo(prResult1.Value) < Tolerance.Global.EqualPoint Then
'Use better comparison method if necessary.
Return SamplerStatus.NoChange
Else
Location = prResult1.Value
Return SamplerStatus.OK
End If
Case 2
Dim prOptions2 As New JigPromptAngleOptions
prOptions2.UseBasePoint = True
prOptions2.BasePoint = Location
prOptions2.DefaultValue = 0
prOptions2.UserInputControls = UserInputControls.GovernedByOrthoMode Or UserInputControls.GovernedByUCSDetect Or
UserInputControls.Accept3dCoordinates Or UserInputControls.NullResponseAccepted
prOptions2.Message = vbLf & "Rotacionar>"
Dim prResult2 As PromptDoubleResult = prompts.AcquireAngle(prOptions2)
If prResult2.Status = PromptStatus.Keyword Then
Return SamplerStatus.OK
End If
If prResult2.Status = PromptStatus.Cancel Then
Angulo = Angle
Return SamplerStatus.Cancel
End If
If prResult2.Status <> PromptStatus.OK Then
Return SamplerStatus.Cancel
End If
If prResult2.Value.Equals(mAngle) Then
'Use better comparison method if necessary.
Return SamplerStatus.NoChange
Else
Angle = prResult2.Value
Angulo = Angle
Return SamplerStatus.OK
End If
Case 3
Dim prOptions3 As New JigPromptDistanceOptions
'prOptions3.SetMessageAndKeywords("Escala [Sim/Não]", "Sim Não")
prOptions3.Message = vbLf & "Escalar>"
prOptions3.UseBasePoint = False
prOptions3.BasePoint = mLocation
prOptions3.UserInputControls = UserInputControls.GovernedByOrthoMode Or UserInputControls.GovernedByUCSDetect
Dim prResult3 As PromptDoubleResult = prompts.AcquireDistance(prOptions3)
If prResult3.Status = PromptStatus.Keyword Then
'Select Case prResult3.StringResult
' Case "Sim"
' mScaleFactor = prResult3.Value
' Case "Não"
' mScaleFactor = 1
'End Select
Return SamplerStatus.OK
End If
If prResult3.Status = PromptStatus.Cancel Then
mScaleFactor = 1
Return SamplerStatus.OK
End If
If prResult3.Status = PromptStatus.Error Then
Return SamplerStatus.Cancel
End If
If prResult3.Value.Equals(mScaleFactor) Then
'Use better comparison method if necessary.
Return SamplerStatus.NoChange
Else
mScaleFactor = prResult3.Value
Return SamplerStatus.OK
End If
Return SamplerStatus.OK
Case Else
Exit Select
End Select
Catch ex As system.Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Erro")
End Try
Return SamplerStatus.OK
End Function