×
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

NX VB Journal - How to Use uf.modl.askfacedata

NX VB Journal - How to Use uf.modl.askfacedata

NX VB Journal - How to Use uf.modl.askfacedata

(OP)
I have defined the following variables

CODE

dim face_t As tag
dim ftype as integer
dim pnts(4,3) as double
dim vecv(4,3) as double
dim box(6) as double
dim junk2 as double = Nothing
dim junk1 as integer = Nothing
And now I am inquiring about some face properties using:

CODE

ufs.modl.askfacedata(face_t, ftype, pnts(jj,0), vecv(jj,0), box, junk2, junk2, junk1)
NX is telling me "Value of type 'Double' cannot be converted to '1-dimensional array of Double'" twice, but I don't know what it is referring to.  According to the NXOpen .Net API reference I've defined all the variables with their correct data types.
Or have I?
Can someone help?

Thanks,
Jeff

RE: NX VB Journal - How to Use uf.modl.askfacedata

The variables pnts and vecv should be 1 dimensional arrays. Try this (untested):

CODE

dim face_t As tag
dim ftype as integer
dim pnts(2) as double
dim vecv(2) as double
dim box(5) as double

dim junk2 as double = Nothing
dim junk1 as integer = Nothing

ufs.modl.askfacedata(face_t, ftype, pnts, vecv, box, junk2, junk2, junk1)

You might get an error because you are passing in junk2 twice. This variable will be used as an output from the function; it may be OK, or it may throw an error because it is trying to write 2 different outputs to the same variable.

www.nxjournaling.com

RE: NX VB Journal - How to Use uf.modl.askfacedata

(OP)
Shouldn't pnts & vecv have 3 elements since I thought they are supposed to be point coordinates and axis directions?

Also, if I want to have data for multiple points on the surface is it not possible to use 2d arrays, somehow?

Thanks,
Jeff

RE: NX VB Journal - How to Use uf.modl.askfacedata

Arrays are zero based. So the pnts(2) array consists of 3 elements:
  • pnts(0)
  • pnts(1)
  • pnts(2)
The same holds true for the vector array.

According to the help file, it doesn't look like you get to input the point and vector information for this function (they are outputs only). What information are you looking to get? Perhaps UF_MODL_ask_face_props would be more appropriate, it allows you to input the face tag and UV parameters you are interested in.

www.nxjournaling.com

RE: NX VB Journal - How to Use uf.modl.askfacedata

(OP)
Thanks!  That is what I wanted all along, but for some reason I thought the VB equivalent of UF_MODL_ask_face_props was ufs.modl.askfacedata.  Now it makes sense.  Let me play for a bit and report back!

Jeff

RE: NX VB Journal - How to Use uf.modl.askfacedata

Quote:

By default arrays are zero based.
Fixed.
There are ways to define a different lower bound, but I would discourage their use unless you have a really good reason.

www.nxjournaling.com

RE: NX VB Journal - How to Use uf.modl.askfacedata

(OP)
I managed to get the askfaceprops method to work, but now I have decided I need to change my overall method for the task I am working on.  I'm sure I'll be posting more queries on the next hurdle.

Jeff

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