Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.
Use your display name or email address to sign in:
Hi all,
First of all excuse me for my English...
I have a problem with a vb.net program which worked on version X8 but doesn't work anymore with version X9.
In order to use the function create_TurnProfile() I used the dll "SilhouetteBoundary.DLL" in this way:
Public Const CHookDLL As String = "SilhouetteBoundary.DLL"
<DllImport(CHookDLL, EntryPoint:="create_TurnProfile", CharSet:=CharSet.Auto)> _
Public Shared Function RunTurnProfile(not_used As Integer) As Integer
End Function
Dim rv As Integer = CHookInterop.RunTurnProfile(0)
Now, with version 9,when I start the program the following error shows up: HRESULT:0X8007007F
From the data I found the function was put in another location: Do you know where it is and how I can use it?
Thanks, Nevio Bassi - Metal World S.p.A.
Hi
On version 6 with this code I set the views to TOP (thanks Roger!).
‘find VIEWS
Dim views As Mastercam.Database.MCView() = Mastercam.Support.SearchManager.GetViews()
'set VIEW
Mastercam.IO.ViewManager.CPlane = views(0) '/TOP
Mastercam.IO.ViewManager.TPlane = views(0) '/TOP
Mastercam.IO.ViewManager.GraphicsView = views(0) '/TOP
Mastercam.IO.ViewManager.GraphicsView.Commit()
Mastercam.IO.ViewManager.TPlane.Commit()
Mastercam.IO.ViewManager.CPlane.Commit()
Me.Close()
I installed mastercam7.
In my program I added the nethook3_0.dll and I rebuilding all, but then result is:
Gview: TOP
WCS: TOP
T/C/ plane= gview
How do I set the T/C plane to TOP?
Any help would be greatly appreciated.
Best regards.
Nevio
Hello Roger, thanks for the answer.
I use visual studio 2010.
In C# works fine.
In Vb.net this is the error(look the attachment)
Is there any problem in vb.net --> nethook2?
Hi
I use Mastercam X6, Het-hook, Vb.net
I will draw a line, i write this code:
MsgBox("Draw a line")
Dim MathLine As Mastercam.Math.Line3D = New Mastercam.Math.Line3D(New Mastercam.Math.Point3D(0.0, 0.0, 0.0), New Mastercam.Math.Point3D(100.0, 0.0, 0.0))
Dim Line1 = New Mastercam.Curves.LineGeometry(MathLine)
Line1.Validate()
'ridisegno
Mastercam.IO.GraphicsManager.Repaint(True)
But the system don't draw a line.
It's an error in my code, o it's a problem in Net-hook?
Thanks for the answer
Hi
I have a question regarding setting a CPLANE with the C-Hook, Mastercam X6.( I have abandoned nethook....()
I cannot find the right method to set the CPLANE (or the TPLANE) to Mastercam predefined graphic views (like TOP, ISO, FRONT,....).
Is there someone who can 'help me?
Thanks in advance
Hi
I have a question regarding setting a CPLANE with the nethook.
I cannot find the right method to set the CPLANE (or the TPLANE) to Mastercam predefined graphic views (like TOP, ISO, FRONT,....).
I tried these:
Dim views As Mastercam.Database.MCView() = Mastercam.Support.SearchManager.GetViews()
' settting the Graphics View to 'IS0' (View#6 of the std views)
Call DialogManager.OK("SETTING GVIEW", "Main.Run")
Mastercam.IO.ViewManager.GraphicsView = views(6)
'SETTING THE CPLANE TO ISO
Call DialogManager.OK("SETTING CPLANE", "Main.Run")
Mastercam.IO.ViewManager.CPlane = views(6)
The gview is OK, but the CPLANE is always 1(TOP).
Is there an option to set the CPLANE (or the TPLANE) by using a method in .net?
Any help would be greatly appreciated.
Best regards.
Nevio
Hello
I would run the DLL "SilhouetteBoundary.dll" from my program VB.NET.
I tried to add the dll in "Add Reference " using the tab "Browse" with which you can 'select a file outside, but when I click on the dll I get a sign that says:
"A reference to 'c:\programmi\mcamx5\chooks\silhouetteboundary.ddl" could not be added. Please make sure that the file is accessible, and that is a valid assembly or COM component.
Is there another way to load it on my program?
Thanks for the answer!
Hi
With the first nethook to change the color of arcs, lines and points I was usually to follow this procedure:
' -- Mask on all alive arcs, lines and points
Do While DataBase.DBSearch(search_idx, found_idx, MC_SELBIT.Alive, MC_ENTMASK.Solid_ID)
' -- Set flag, gets set for each iteration but who cares
bFound = True
' -- Get the current ent from its id
Dim Obj As Object = DataBase.GetEnt(found_idx)
Dim ThisEntRef As New CEntRef(found_idx)
'Mastercam.GUI.SetCPlaneNumber(2) ' piano di costruzione obbligatorio metterlo
'setto il colore 10 - verde -
DataBase.SetEntColor(found_idx, 8)
'ruota
' Mastercam.XForm.Rotate(ThisEntRef, True, punto, ruota, 2)
' -- clean up, not really needed but it makes me feel better
'ThisPoint = Nothing
ThisEntRef = Nothing
Loop
With the new version (nethook 2 X5) as I can make a loop on all the entities 'to change the properties'? Do you have any example?
Thank you for the cooperation.
Nevio
eMastercam - your online source for all things Mastercam.
Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.