Jump to content

Welcome to eMastercam

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:

LMVUICHARD

Verified Members
  • Posts

    21
  • Joined

  • Last visited

Everything posted by LMVUICHARD

  1. Wow, I hadn't seen these new improvement!! Thank you very munch for your incredibly quick answer!.. Efficient and very helpfull!!! Thanks again!
  2. Sorry, i've send my message before finishing it... One of our customers ask us to have a small application to automatically create lines on the edges of a stock model manually defined, like this: With OperationsManager.JobSetupStockOrigin, and OperationsManager.JobSetupStockSize that's easy to done But one problem remain: if operator change the stock model origin, how it will be possible to retrieve it? Thanks in advance...
  3. Hello, One of our customers ask us to have a small application to automatically create lines on the edges of a stock model m
  4. Wow… thanks for the informations. Roger as asked, i've send you an email. Thanks for all!
  5. I meet some dificulties with the SearchManager.GetOperations Method. It seems that Method run only with milling operations. If i try to run it with a basic lathe machining file, with some turning operations and some drilling, the code below returns only the drillings operations. With a milling file, it's run properly, but impossible with a lathe file (i don't have try with a wire file, but it will be probably the same). I have try with some modifiers, (you can see in comments), but result is the same. What is the way in NetHook to load an array with really all operations, not depending machining technology? i need only access status (get) in the Msbox, and get or set only posting, displayToolpath. Its very easy to test, the code is only to paste in a standard Mastercam vb.net template, and i join the mastercam test lathe file too. Thanks in advance Mastercam version:2020 Code: Private Sub OnOkView(sender As Object, e As EventArgs) Handles buttonOK.Click Dim Tl As Tool = Nothing 'Dim Optp As OperationType = Nothing 'Dim Operationss = SearchManager.GetOperations(-1, -1, True, Tl) 'Dim Operationss = SearchManager.GetOperations(True) Dim Operationss = SearchManager.GetOperations() For IndxBcl = 0 To Operationss.Count - 1 If Operationss(IndxBcl).Selected = True Then MsgBox("Opération ID:" & Operationss(IndxBcl).GetOperationID() & " Name:" & Operationss(IndxBcl).Name & " Tool:" & Operationss(IndxBcl).OperationTool.Number & " Posting:" & Operationss(IndxBcl).Posting & " Display:" & Operationss(IndxBcl).DisplayToolpath & " Dirty:" & Operationss(IndxBcl).Dirty) End If Next End Sub Julien-LMV2.mcam
  6. Thanks for your answers Byte (Peter?)! For the bitmap side, I have already tryed to use the windows graphic management. But there is a big issue with 4K screens (3840x2160). To manage with these, it's mandatory to make some additionnal declarations in the dot.net project (Add a manifest file, make some declarations (Win10 app, Dpi Aware app, etc..). https://docs.microsoft.com/en-us/dotnet/framework/winforms/high-dpi-support-in-windows-forms I have try to do it and that run normally on a stand alone windows form. But when i try to do that inside a NETHook project, and run it inside Mastercam, that's wrong, these declarations have no effect and all cursor position or windows dimensioning refers to a screen resolution with 1920x1080 one quater of the real screen... It's not possible or I have not been able to properly insert the statements. I believe that in any case the app inherits The Windows settings of Mastercam, and I can not change them. That's the reason I want to try with NetHook commands, I hope that will gave a different result. For the other side, sorting of Mastercam entities, for sure, there is many ways to do that, If it's possible to retrieve the view coordinates of user's box, i think it will be easier, i have some ideas to achieve that (most based on arrays, yes...). Thanks for your help!
  7. Thank you for your quick answer. Probably, one again more, I’ve gave you bad explanations, sorry my English isn’t, one again more, very clear… It's a part of a big customer project we have, and to solve it, we are looking for the better solution. Inside this project, it can be a way if it's possible to make somes extractions directly Inside a Mastercam session that's the reason i try to test that. What I want to do: - Ask the user to make a box selection - Letting him to do that on the graphics screen area - After it’s done, retrieve the box corners values the user has done - With these values, launch the two treatments I need, on Entities and on bitmap image. I think I have the ability to do that. I have seen the SelectionManager.WindowSelect method, but it’s not what I want. With that I must give the corners coordinate, not retrieve the user's one, it’s exactly the reverse… As asked, I've send an e-mail at [email protected] with more explanations. Thanks
  8. Hello, Is it possible to retrieve the corners coordinates of a user box selection ? (in view coordinates AND screen coordinate, for a projected application, i will need the both...) For example, after a line like this : SelectionManager.BoxSelectGeometry("Select the holes", New GeometryMask(True), 1) How is it possible to know the corner position of the user selection box? I have try to use and understand the "McUIEvent.GetEvent Method", without success. I don't understand how i must use the UIEventData Class, Is it possible to give me some example with this Method and this class? Thanks in advance! I use VS2019 Vb.net, with Mastercam 2020
  9. Hello, I use Mcam 2020 Version, and try to make some applications with Vb.net and VS2019. I have try to create a multi-lingual application, with separated language files. First i have try to make a basic application with a simply windows form: i have add to my project three resources files: On each, two values: AppMess.resx: Button1 | Button1 Label1 | Label1 AppMess.en.resx: Button1 | French Label1 | TITLE AppMess.fr.resx: Button1 | Anglais Label1 | TITRE I have add a very simple Form (Form1) to my project, with only one Label and one button, and write this code: Imports MultilingualAPP.My.Resources Public Class Form1 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load My.Application.ChangeUICulture("en-US") My.Application.ChangeCulture("en-US") Call actualize() End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim RM As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1)) If My.Application.UICulture.Name = "en-US" Then My.Application.ChangeUICulture("fr-FR") My.Application.ChangeCulture("fr-FR") Call actualize() Else My.Application.ChangeUICulture("en-US") My.Application.ChangeCulture("en-US") Call actualize() End If End Sub Private Sub actualize() Label1.Text = AppMess.Label1 Button1.Text = AppMess.Button1 End Sub End Class That's ok, each click on the button changed the form text language. I have try to do exactly the same thing in a NET-Hooks C# and VB.NET project examples. But in this project, no text change, that's only the default text (AppMess.resx) who is called... What is wrong? Is there some modifications to make to the project? What is the way to create a Multilingual application in a MC NET-Hook project? I try to join my two trials, hope that will be usable... Thantk's in advance! MC_MultilingualAPP.zip MultilingualAPP.zip
  10. Thanks for your answer! I work on Mcam2020. Never had try to code in C++ and neither used the SDK package. i only try to code on vb.net with Net-HOOK, unfortunately... Do you think it would be easy to create a C++ dll called by a vb.net program to do that? Do you think that would be possible for a beginner like me? C++ is it a part of Visual Studio or another standalone software (sorry, I don't have made any search, it's only to know if it's easy to make some tests)? is existing some programming examples arround geometry manipulation and groups in C++?
  11. Hello, I have a question about geometry groups: With Net-Hook, is it possible and what is the way to create a geometry group, add and remove entitys on it, name it or rename it? I need to manipulate many entitys, (points, lines arcs splines, surfaces, solids, meshes...) and it would be easier to group them through a group. These entitys can be selected by the user or come from the result group. In fact, i need to do with Net-HOOK, what the geometry group manager does (New, name a new group, and add some entitys on it). In the on line documentation, i have found many information about toolpath an tool groups, but nearly nothing about geometry group... And nothing too in the on-line examples... Thanks in advance for your help!
  12. Big thank you for your contribution Peter! For the moment, i'm just in exploration of the NetHook capabilities. But what you write, and other tips you've posted gave me want to explore in addition on sdk and Chook... I'm more used to Vb (Sorry…). But i hope i can understood quickly the C (++ and #) basics keys... at least i can try! Now the problem for me is to find enough time to read, write and test between possibilities... Thanks to you!
  13. Yes, i know this option, but it create ALL edges in the model, for only few needed... Cleaning and sorting after is not shorter compared to create some. Create some edges it's not really a big deal, but it's make the application less "Fully native solid integrated"... Many users, coming from CAD solid world, don't understand it be needed to create wireframe geometry before all... But thank you for your proposal!!
  14. Thank you very much for your quick answer, despite its content... decidedly, i'm a little bit unlucky with Net-Hook projects! Have a nice day!
  15. hello, I have one question i dont have found any answer in the online documentation. Is it possible with NetHook to have, without create any additionnal geometry, the canonic datas of a solid edge? - The type (Arc, Line, Nurbs…) - And the data (Arc center, radius, plane or line ends) ? In Mastercam, that's possible for exemple with analyze function, but is it possible to do the same in a Net Hook program and access to all of these data? Thanks in advance!
  16. Thank you very much for your help! I have seen the online documentation, i work already with. I find it a little bit succinct and lack set of examples of uses (I know, you maked some application examples, i have download it, but nothing about Mcview for example). It exists, it's already good, and I understand the work it requires... I had try to use both commands "ConvertToViewCoordinates" and "ConvertToWorldCoordinates", to now, without any success... Probably, due to some misunderstanding from my side about how these two commands really runs. For the moment, I don't have any time left, but I'll look at that up quietly as soon as possible. I note the e-mail adress and will use it if i don't find myself any solution. Thank's again!
  17. To try to give a clearers explainations: 1/ Mastercam part: 2/Modifications in your code: Dim targetView = New MCView() Dim found = False Dim TargetName As String = arc.View.ViewName For Each view In allViews If String.Compare(view.ViewName, TargetName, StringComparison.OrdinalIgnoreCase) = 0 Then 3/Result: 4/ Second modification in your code: For Each view In allViews If String.Compare(view.ViewName, TargetName, StringComparison.OrdinalIgnoreCase) = 0 Then targetView = view found = True Exit For End If Next targetView = arc.View found = True If Not found Then Return False End If (Ok, after that , a lot of lines are useless, but it's for the test…) 5/ Result: Obviously, there is a link with the graphic view...
  18. Sorry, if my explainations are not clear... my english is not at it's top, but i can try to explain again, thank you, for your effort of understanding! If, in Mcam, in top view, you draw one arc at any position, and in front cplane you rotate it arond origin of 45° -> this arc depend of no referenced named view in the view manager. It's this "no name", what i have named "exotics view". if we analyse it, it's view number is 21. it's the same in the code, arc.viewnumber=21 It's the reason i don't have use the named view, and beause of that it's impossible to search, for these arcs, the named views. In my original code, it' the reason i have try to use "a.view", the arc's Mcview clicked by the user for the plane rotation. I have try to understand what was going on and have analyse all arc data. i think the problem come from the returned arc's Mcview matrix, who is changed, depending on the display view. i have try to load it in a new MCview, and convert it each point in WCS, but it's run approximatively only if i try it in a top view. i don't know what it be possible to do to have directly the arc's MCview, in WCS coordinates who can be simply use in the .Translate command. its more clear for you? I can give you some examples, but if you make only one top arc rotation from any side view, you can see my code is wrong, and your's proposal make nothing. Thank's for your help.
  19. Thanks for your very quick answer! I have try your code, but it don’t solve my issue. If the user click on an Arc based on a no-standard view -> this view don’t have any name, and your routine create nothing! I have try to address the name this no-standard arc view, with: Dim arc = CType(geom, ArcGeometry) If arc.View.ViewName = "" Then arc.View.ViewName = "tibidi" arc.Commit() End If Dim TargetName As String = arc.View.ViewName 'Dim TargetName As Integer = arc.View.ViewNumber ' Get ALL MCView (Planes) data in the file. Dim allViews = ViewManager.GetAllViews(False) ' Search for the destination view "by name". Dim targetView = New MCView() Dim found = False For Each view In allViews If String.Compare(view.ViewName, TargetName, StringComparison.OrdinalIgnoreCase) = 0 Then targetView = view found = True Exit For End If Next But, again, this solve nothing, because: Dim allViews = ViewManager.GetAllViews(False) Load only standard Mastercam views, from “top” to “trimetric”, but not the "exotics" views...
  20. Hello, I’m beginner in Hook and vb.net, but I try to build some dedicated applications. I have write some, with success, but now I meet an issue, difficult I think, to solve by myself. I need to move some geometrys between views, and I think I have some misunderstanding about how Mastercam Mcview run. To explain more simply what I mean, I have write a very small test where I draw one Arc in Top view and try to move it on different arc plane. That works normally for standard Mcam view, but not in any no-standard view, why? It Seem, with a no-standard view, that Mcam move geométries in the current display view plane. how is it possible to place them in the selected arc plane? Thank's in advance for your help Code: ' -------------------------------------------------------------------------------------------------------------------- ' <copyright file="NethookMain.vb" company="CNC Software, Inc."> ' Copyright (c) 2018 CNC Software, Inc. ' </copyright> ' <summary> ' If this project is helpful please take a short survey at -> ' http://ux.mastercam.com/Surveys/APISDKSupport ' </summary> ' -------------------------------------------------------------------------------------------------------------------- Imports Mastercam.App Imports Mastercam.App.Types Imports Mastercam.IO Imports Mastercam.Support Imports Mastercam.Curves Imports Mastercam.Database.Types Imports Mastercam.Math Public Class NethookMain Inherits NetHook3App #Region "Public Methods" ''' <summary> ''' This method is designed to be the main entry point for your NetHook app. This is where your app should do ''' all of the things it's supposed to do and then return an MCamReturn value representing the outcome of your ''' NetHook application. ''' </summary> ''' <param name="param">Parameter is not used</param> ''' <returns>A <c>MCamReturn</c> return type.</returns> ''' <remarks></remarks> Public Overrides Function Run(param As Integer) As MCamReturn Dim ArcSup As ArcGeometry Dim a As ArcGeometry Dim ConvertToWorldCoordinates As Point3D Do If SearchManager.GetSelectedGeometry().Any() Then SelectionManager.UnselectAllGeometry() End If a = SelectionManager.AskForGeometry("Select Arc", New GeometryMask(False, False, True, False, False, False, False, False)) If IsNothing(a) = True Then Return MCamReturn.NoErrors Exit Function End If ArcSup = New ArcGeometry(SearchManager.GetViews(1)(0), New Point3D(0, 0, 0), 15.0, 0.0, 360.0) ArcSup.Commit() ConvertToWorldCoordinates = ViewManager.ConvertToWorldCoordinates(a.Data.CenterPoint, a.ViewNumber) ArcSup.Translate(New Point3D(0, 0, 0), ConvertToWorldCoordinates, SearchManager.GetViews(1)(0), a.View) GraphicsManager.ClearColors(New GroupSelectionMask(True)) GraphicsManager.Repaint(True) SelectionManager.UnselectAllGeometry() a = Nothing Loop Return MCamReturn.NoErrors End Function #End Region End Class

Join us!

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.

Follow us

×
×
  • Create New...