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:

Recommended Posts

I have typed following code:

 

code:

while n < z

Line(n) = New LineGeometry(Endpoint(0+x), Endpoint(0+2*x))

x += 1

n += 1

End while

The result is sth like:

Line(1) = New LineGeometry(Endpoint(1), Endpoint(2))

 

I tried to commit these array based Line like this:

 

code:

while m < a 

Line(m).commit

m += 1

End while

But all I get is an error message: Commit has a return type that is not supported or parameter types that are not supported.

Does anybody know how I can solve this problem?

Link to comment
Share on other sites

Pokemon,

 

I assume your "Line" variable is some sort of an Array or ArrayList (let's just call it a collection)? Working from that assumption, what's probably happening is the compiler doesn't realize that the items in your collection are all LineGeometry objects. Try casting your objects like so:

 

code:

while m < a 

LineGeometry CurrentLine = Line(m)

CurrentLine.Commit

m += 1

End while

See if you have better luck with that. Feel free to come back if you have any further questions.

Link to comment
Share on other sites

Hey Mike!

 

Thank You for your help. First you are right, my lines are supposed to be "collections". I tried your solution but Visual Studio 2005 says that LineGeometry is a "type and canot be used as an expression". Further it says that currentLine is not declared. I was thinking about how to solve the 2nd problem but im not sure how to declare...

I have tried some possibilities but nothing works, yet confused.gif

Link to comment
Share on other sites

I am not entirely sure what you are doing but perhaps this code might help?

 

code:

  

 

Dim Lines As ArrayList = New ArrayList()

Dim n As Int32 = 0

Dim x As Int32 = 1

Dim z As Int32 = 10

 

While n < z

Lines.Add(New LineGeometry(Endpoint(0 + x), Endpoint(0 + 2 * x)))

x += 1 : n += 1

End While

 

For Each l As LineGeometry In Lines

Dim thisLine As Mastercam.Database.Geometry = l

thisLine.Commit()

Next

 

GraphicsManager.FitScreen()

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