Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IFRs on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Journal - CrosHatch 1

Status
Not open for further replies.

DavidQ

Industrial
Oct 11, 2012
53
Hello Eng-Tips.
I am trying to use CrossHatch on a curve array (representing a letter) thru a journal but NX report an error: "Unable to cast object of type NXOpen.NXObject[] to type NXOpen.Curve[]" .See attached journal (VB) to find mistake.

Regards
 
Replies continue below

Recommended for you

Thanks ufsure!!! just a few questions...
- Which is the difference between declaring kLine as Curve and as Line? So far there is no problem with code, where is the advantage?
-Im trying to made this crosshatch as a Function, what could change in the code?. Attached you will find the code (with some issues).

Regards
 
 http://files.engineering.com/getfile.aspx?folder=db8df9c8-66aa-4edd-b24d-449832ba14d4&file=k1_crosshatch_as_function.vb
You could leave kLine as Line but you need to cast it (change its type) to Curve before passing it on to the CreateRuleCurveDumb function.

I have corrected your code. You should be passing the kLine as an array of curves by reference as shown in the attached code.


Suresh
www.technisites.com.au
 
 http://files.engineering.com/getfile.aspx?folder=7ba0fe48-4b03-48b6-aad1-f4bbed468e27&file=k1_crosshatch_as_function.vb
Thanks ufsure!!! It really helps. I managed to add a couple of arcs to the kLine array and solved some issues regarding the CurveDumbRule, I fixed this by changing the MidPoint of the arc (try and error); now I add a new letter (three more in the way) with arcs I get the same issue and I cant manged to solved. I'm using the NXOpen .Net API Reference but there isn't much information to understand CurveDumbRule Method (a few Do's or Don'ts would help in this document).
 
 http://files.engineering.com/getfile.aspx?folder=d1071760-6ff6-4eef-b3d8-efb8742c224e&file=k1_crosshatch_as_function1.vb
Thanks ufsure for your help!!! Now I can correct the rest of the letters without issues. [2thumbsup]

Best Regards.
 
Hello ufsure, thanks for your support on this thread. Now that I have time to go back to this journal I found an issue with the cross hacth when I try "move" by code the lines (region) involved on the crosshatch. Attach you will find the journal that i'm working on.

Regards
 
 http://files.engineering.com/getfile.aspx?folder=2eeea76d-e482-4739-bbe9-b82f3fe10325&file=journal_crosshatch_lines.vb
Status
Not open for further replies.

Part and Inventory Search

Sponsor