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 - CrossHatch Issue 1

Status
Not open for further replies.

DavidQ

Industrial
Oct 11, 2012
53
Hello Eng-Tips. I have an problem with the attached journal. This journal build a set of line with crosshatch inside the enclosed area but when the postion of the lines change the crosshatch is build outside the enclosed area. So far I couldn't found the problem, can anyone take a look??.

BestRegards
 
Replies continue below

Recommended for you

Try changing your "help point" for each cross hatch.
I changed/added the highlighted code in your AddCrossHatch function.

Code:
[COLOR=blue]Dim[/color] nullNXObject [COLOR=blue]As[/color] NXObject [COLOR=blue]= Nothing[/color]  

[COLOR=green]'Dim helpPoint1 As Point3d = New Point3d(22.9249159645684, 40.0055496572782, 0.0)[/color]
[highlight #FCE94F][COLOR=blue]Dim[/color] helpPoint1 [COLOR=blue]As[/color] Point3d
[COLOR=blue]If TypeOf[/color] (Lines(0)) [COLOR=blue]Is[/color] Arc [COLOR=blue]Then[/color]
    [COLOR=blue]Dim[/color] t [COLOR=blue]As[/color] Arc [COLOR=blue]=[/color] Lines(0)
    helpPoint1 [COLOR=blue]= New[/color] Point3d(t.CenterPoint.X [COLOR=blue]+[/color] t.Radius [COLOR=blue]*[/color] Math.Cos(t.StartAngle), t.CenterPoint.Y [COLOR=blue]+[/color] t.Radius [COLOR=blue]*[/color] Math.Sin(t.StartAngle), t.CenterPoint.Z)  
[COLOR=blue]Else[/color]  
    helpPoint1 [COLOR=blue]= New[/color] Point3d(22.9249159645684, 40.0055496572782, 0.0)  
End [COLOR=blue]If[/color][/highlight]

section1.AddToSection(rules1, Lines(0), nullNXObject, nullNXObject, helpPoint1, Section.Mode.Create, [COLOR=blue]False[/color])


www.nxjournaling.com
 
Thanks Cowski!!! This solve the issue, but what exactly do these lines?

BestRegards.
 
The "help point" helps to define what area to crosshatch. Using the same help point for each region may not give the desired results, as is evident with your original code. The help point needs to be defined for each region. The code I added changes your help point to be equal to the start point of Lines(0). This way the help point changes with each region of curves that you draw.

Note: the code I added was for testing and is not very robust. It assumes Lines(0) is going to be an arc; but since all your curves are arcs, this is a pretty safe assumption. However, should you use this code "as is" on a region made only of lines or a mixture of curve types, it will probably fail. I'll leave it as an "exercise for the reader" to modify the code if/when it is necessary.

www.nxjournaling.com
 
I add four more regions (made only of lines or arcs, not mix) and it works fine for what I need, but adding a line to a region of arcs or viceversa fail as you said, the journal stop with a warning window about "Unhandled exception has occured in a component in your app..." after that it stop exactly where the region change from line, line, line to line, line, arc...

BestRegards, and thanks for your help!!!.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor