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:

Operations & nethooken


Recommended Posts

Anyone know how to reference individual operations using a nethook?

 

they have a coperationref class, but I dont know how to set it equal to an existing operation.

 

any clues would be greatly appreciated smile.gif

 

banghead.gif

 

what would be ideal.... is to have the operations grouped as a collection.

then have each operation referenced as an "item"

 

so then you could get the operationgroupcount

like is there

then just loop through the operation collection

replacint the item numbers 0 - etc....

Link to comment
Share on other sites

or it could go

I'll abbreviate a little

dim machinegroupcount As Integer

machinegroupcount = mcam.tpath.getmachinegroupcnt

 

then

dim machinegroupA As machinegroup

machinegroupA = mcam.tpath.getmachinegroup(i)

 

dim opgroupcount As Integer

opgroupcount = machinegroupA.getopgroupcount

 

dim opgroupA As opgroup

opgroupA = machinegroupA.getopgroup(i)

 

dim opA As COperationRef

opA = opgroupA.getop(i)

 

etc..etc....

Link to comment
Share on other sites

Below is some code I was using to test out some stuff, it might be useful.

 

code:

 

try

{

 

int groupCount = Groups.GetGroupCount();

 

for (int grp = 1; grp <= groupCount; grp++)

{

 

string grpName = Groups.GetGroupNameFromNumber(grp);

 

if (grpName != null)

{

 

if (Groups.IsMachineGroup(grpName))

{

string next = Groups.GetNextGroup(grpName);

 

 

 

}

else if (Groups.IsToolpathGroup(grpName))

{

if (grpName == "Nesting Results")

{

 

 

}

 

}

else

{

 

 

string next = Groups.GetNextGroup(grpName);

 

}

}

 

 

 

}

 

 

}

catch (Exception ex)

{

 

}

finally

{

 

}


Link to comment
Share on other sites

mmmmmmmm......

 

I can get group names and group numbers.

 

but to actually set my operationref class to the operation itself.

 

operationref = mastercam.?.?

 

how do we go about doing that?

 

cus we dont have a groups.getnextgroup function

 

orrrrrr wait a minute.......

 

issss it. COperation = New then use the grpName?

Link to comment
Share on other sites

nope that wattin it.

 

hm. well. I dont know.

 

looking through the object browser I just really can't see anything that'd do it.

 

cus even if you wanted to create a new coperationref using an existing coperationref

like as one of the overrided options would supposively accept.

How the hecks would ya reference one to even put in there for it to copy????

 

this thing is sooooo close yet so far away.

 

well I'm tired. hitter again tomorrow.

 

ya know. and really. we should be able to access all of mastercams functionality just as we're able to access the functionality of our own forms and functions.

 

I was going to start out and develop a "flymode" for X but we're not really able to set a new view like how a user could.

 

in all technicality. I should be able to create an axis. then set a view using my x line and the z line that would be created in the nethook.

 

then just move the axis continuously.

during refresh re-associate the X and Z lines.

 

mm mm. sounded like a good idea.

Link to comment
Share on other sites

smile.gif I've been fightin the get filename for a while now.

 

if it were as simple as mcfile.getcurrentfilename()

 

this'd be a done deal.

 

the only members I have under mcfile is

 

EditFile

NewMC

SetFileUnchanged

DoBitmapFile

DoFileOpen

DoFileOpen

DoMetaFile

GetPathFromExt

GetPathOfThisScript

ImportFile

OpenMC

ReadDXF

SaveMC

SaveMCAs

WriteDXF

which most require a complete filename

which if to be useful would need some way of getting the current filename.

 

but there's nothing about the actual filename itself??

 

which we could get tricky and search to the current directory, and search through the files for the most recent.

But for 1 we're risking a system lockup

2) we wouldn't be for sure if the most recent file saved is actually the file that made the nethook call.

 

And for getting the operations there's no

getoperations member. even under tool path

all I have for toolpath is:

 

EditTool

RunPointManager

SetBlockDrillLibrary

SetPostName

SetToolLibraryName

DoNest

EditOperationGeometry

EditOperationParameters

GetBlockDrillLibraryName

GetJobSetupMaterial

GerJobSetupStockOriginX Y and Z

GerJobSetupStockSizeX Y and Z

GetNestedSheetCount

GetOperationCount

GetPostName

GetToolLibraryName

MakeNestedSheetBMP

RegenOp

 

Nothing about getting an actual tool op.

Which most of these members require a referenced tool op ref... ya know, itslike we have a system of equations trying to solve for 2 unknowns.

shouldn't be that complicated.

 

Under groups there should be a member that refers to the machine groups.

then under toolpath there'd be a member for getting the ops from the machine group.

just as there is a way to get a tool from an op.

 

because under the groups all we have are ways of getting name from number

number from name which if the user changes names

we really wouldn't have a way of distinguishing one type of group from another, only by group type. but now you're going to have more if then checks that wouldn't be necessary.

if there was just a separate member for the different kind of groups.

 

In alllll honosty. These nethooks are almost useless. because thus far. all the functionality could be done by just making an MCX file that has already created geometry and what not and just merge and stuff.

 

We really dont have much control over modification. which is what we really desire.

Because then we could use the power of associativity and really do some neat stuff.

 

The only other option I guess is to abandon the nethook approach go back to C-Hooks

But thats old technology.

And actually proves that internally. X is no different than it was 10 years ago.

Link to comment
Share on other sites

Under groups all I have is

 

deletegroupfromname

deletegroupfromnumber

addenttogroup

creategroupfromname

getgroupcount

getgroupname fromnumber

getgrouptype fromname

getgrouptype fromnumber

removeentfromgroup

setgroupname

 

there really outa be

 

getentgroup(byval integer)

getmachinegroup(byval integer)

 

separated like that or something

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

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...