×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Question on Dumb Rules in journals

Question on Dumb Rules in journals

Question on Dumb Rules in journals

(OP)
I have a recorded journal, which I simplified and successfully tested. the section in question reads as follows:

CODE --> vb

scCollector2 = extractFaceBuilder3.FaceChain

faces2(0) = face1
faceDumbRule2 = workPart.ScRuleFactory.CreateRuleFaceDumb(faces2)

faces3(0) = face3
faceDumbRule3 = workPart.ScRuleFactory.CreateRuleFaceDumb(faces3)

rules4(0) = faceDumbRule2
rules4(1) = faceDumbRule3
scCollector2.ReplaceRules(rules4, False)

extractFaceBuilder3.FixAtCurrentTimestamp = True

feature3 = extractFaceBuilder3.CommitCreateOnTheFly() 

I wish to pass an array of values, so I changed it in my program as follows:

CODE --> vb

scCollector2 = extractFaceBuilder3.FaceChain

      itm2 = checkFace.Length - 1

      Dim rules4(itm2) As SelectionIntentRule

      For itm1 = 0 To itm2
         faces1(0) = checkFace(itm1)
         faceDumbRule1 = workPart.scRuleFactory.CreateRuleFaceDumb(faces1)
         rules4(itm1) = faceDumbRule1 
      Next itm1

      msgbox("Rule4 Set")

      scCollector2.ReplaceRules(rules4, False)

      extractFaceBuilder3.FixAtCurrentTimestamp = True

      feature3 = extractFaceBuilder3.CommitCreateOnTheFly() 

The code successfully appears to complete everything up to the message box saying "Rule4 Set." However where the previous code had no problem with the commitCreateOnTheFly now it fails.

I was hoping that the values would be set in the array and using the DumbRule multiple times would not make a difference, but suspect that is where I'm failing.

Does rules4(0) = faceDumbRule2 actually save the variable name? so each instance of Rules4() have to have an individual variable left alone for it to access? Or does my problem lie else where.

Thank you for your time.

RE: Question on Dumb Rules in journals

Are you selecting multiple faces for a single extract face feature? If so, you can pass in the entire array of faces when you create the rule. Something like:

CODE

Dim myFaces() As Face
'... code to add desired faces to array
Dim faceDumbRule1 As FaceDumbRule
faceDumbRule1 = workPart.ScRuleFactory.CreateRuleFaceDumb(myFaces)

Dim rules1(0) As SelectionIntentRule
rules1(0) = faceDumbRule1
extractFaceBuilder1.FaceChain.ReplaceRules(rules1, False) 

If you are looking to create multiple extract face features, then this approach may not work...

www.nxjournaling.com

RE: Question on Dumb Rules in journals

(OP)
I have multiple faces.

I'm going to be using the intersection curve to measure the distance between two sheet bodies on a complex surface and need to be able to move it through the length of the part without having to reselect.

thanks

RE: Question on Dumb Rules in journals

(OP)
I'm getting an error saying "Selected faces will create more than one output body.

I'm not sure this is entirely due to this section of code anymore as I discovered that the code I thought was working, which I simplified from the recorded journal, is not creating an intersection curve but instead creating a spline.

Further investigation proceeding to see if I can narrow down the issue.

RE: Question on Dumb Rules in journals

Are you creating an intersection curve feature? If so, the underlying geometry is generally a spline; perhaps the output is correct.

www.nxjournaling.com

RE: Question on Dumb Rules in journals

(OP)
I got the line to create now using your previous solution, but the problem is that despite a line saying associative = true, I am still getting a spline. Which is unassociative.

I'm near the point of posting the whole sub to see if some one else can find what I have forgotten.

thanks for your help.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources