Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

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

Status
Not open for further replies.

jmarkus

Mechanical
Jul 11, 2001
377
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
 
Replies continue below

Recommended for you

The variables pnts and vecv should be 1 dimensional arrays. Try this (untested):
Code:
dim face_t As tag
dim ftype as integer
[highlight]dim pnts(2) as double
dim vecv(2) as double
dim box(5) as double[/highlight]
dim junk2 as double = Nothing
dim junk1 as integer = Nothing

ufs.modl.askfacedata(face_t, ftype, [highlight]pnts, vecv, box,[/highlight] 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.

 
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
 
Arrays are zero based. So the pnts(2) array consists of 3 elements:[ul][li]pnts(0)[/li][li]pnts(1)[/li][li]pnts(2)[/li][/ul]
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.

 
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
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor