JasonL
-
Posts
8 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Store
eMastercam Wiki
Blogs
Gallery
Events
Posts posted by JasonL
-
-
I am having a problem using the C-hooks project template for Visual Studio 2013 Community. I have the SDK installed and the CHookWizard.dll registered. When I start a new mastercam c-hook project I get the error message in the attached image. I've done alot of digging and I'm not really getting anywhere. Any input would be great. Thanks.
-
I just have a simple question. Is it possible to create a nethook for mastercam for solidworks. I guess this would have to be a standalone app?
-
I'm trying to find a way to Get or Set the post processor for the current machine group with a Nethook. Not sure if this is possible, I've been searching quite a bit. Just wanted to see if anyone ever had to do this.
-
Ahhh! Thank you!
-
Here is the zipped up project file
-
Dim chains() As Mastercam.Database.Chain
chains = ChainManager.GetMultipleChains("Please select Geometery to build taper off of")
For Each c As Chain In chains
c.Direction = Mastercam.Database.Types.ChainDirectionType.CounterClockwise
GetPeninsulas(c)
Next
Sub GetPeninsulas(chain As Mastercam.Database.Chain) ' one letter at a time
Mastercam.IO.SelectionManager.UnselectAllGeometry()
Dim curves() As CurveGeometry = ChainManager.GetGeometryInChain(chain)
For Each cs As CurveGeometry In curves
If cs.GetType = GetType(ArcGeometry) Then
cs.Selected = True
cs.Commit()
End If
Next
Dim geo() As Geometry = SearchManager.GetSelectedGeometry
For Each cs As CurveGeometry In curves
Highlight(cs, True)
Next
End Sub
Sub Highlight(c As CurveGeometry, display As Boolean)
c.LineWidth = 3
c.Commit()
GraphicsManager.Repaint()
If display = True Then
If c.GetType = GetType(Mastercam.Curves.ArcGeometry) Then
Dim a As ArcGeometry = CType(c, ArcGeometry)
PrintArcData(a)
ElseIf c.GetType = GetType(Mastercam.Curves.LineGeometry) Then
Dim l As LineGeometry = CType(c, LineGeometry)
Dim m As Double = (l.Data.Point2.y - l.Data.Point1.y) / (l.Data.Point2.x - l.Data.Point1.x)
Dim Angle As Double = 180 - Atan(m) * 180 / PI
m = Round(m, 5)
MsgBox("Slope is: " & m & vbCrLf & "Angle is: " & Angle)
End If
Else
MsgBox(" ")
End If
c.LineWidth = 1
c.Commit()
End Sub
Sub PrintArcData(ByVal a As ArcGeometry)
Dim s As String = "Center Point: " & "( " & Round(a.Data.CenterPoint.x, 5) & " , " & Round(a.Data.CenterPoint.y, 5) _
& " , " & Round(a.Data.CenterPoint.z, 5) & " )" & vbCrLf
s = s + "Start Point: " & "( " & Round(a.EndPoint1.x, 5) & " , " & Round(a.EndPoint1.y, 5) & " , " & Round(a.EndPoint1.z, 5) & " )" & vbCrLf
s = s + "End Point: " & "( " & Round(a.EndPoint2.x, 5) & " , " & Round(a.EndPoint2.y, 5) & " , " & Round(a.EndPoint2.z, 5) & " )" & vbCrLf
s = s + "Radius: " & Round(a.Data.Radius, 5) & vbCrLf
s = s + "Start Angle: " & Round(a.Data.StartAngleDegrees, 5) & vbCrLf
s = s + "End Angle: " & Round(a.Data.EndAngleDegrees, 5) & vbCrLf
s = s + "Sweep Angle: " & Round(a.Data.EndAngleDegrees - a.Data.StartAngleDegrees, 5) & vbCrLf
MsgBox(s)
End Sub
-
I am working on a net-hook that will analyze chains of lines and arcs that make up letters, which we use for milling embossings, and then create new geometry based off of the original geometry. In order to do this I need to iterate through these entities and run a lot of math on their data(ex. start/end point for lines; start/end point, center point, start/end angles for arcs).
I have the net-hook printing all of that data just to check and make sure it was capturing those values correctly and I noticed the arc center point was not correct. When I do a standard mastercam analyze entity function, it reads it correctly but not when my nethook reads it. I also noticed this only happens when the arc viewnumber is anything but 1. I tried to have my nethook change these arc view numbers before it read the data values but it just ended up moving the arcs themselves. The start and end angles are also off, as if the view its measuring in is tilted. One thing that I find strange is that the start and endpoints are correct. My only guess is that the "Data" object for the ArcGeometry class takes into account this arc viewnumber. I also have no idea what an arc view number is.
I guess I just need to figure out how to read this data from the correct view?
C-hooks Project Template Problem
in Mastercam C-Hook, NET-Hook and VBScript Development
Posted
Problem solved. I had installed the SDK AFTER installing VS 2013 ( I had been using 2012). I just reinstalled the SDK and it works.