Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Transfer "model preview" into BlockStyler dialog

Status
Not open for further replies.

lklo

Industrial
Nov 24, 2010
226
Hi all...

I'm in the very early beginning of next project...

But upfront I will like to ask, if some of you, have been playing with extract a specifik NX parts model preview using NXOpen (vb-net).

In my code, I will transfer all unique components parts, into a TreeListControl using BlockStyler...
some attribute manipulations and edit's shall be possible for each Part selected in the TreeList in BlockStyler dialog...
All this is straight forward - But I am also thinking about, to get the selected Parts preview, being displayed as a bitmap, in the dialog...This approach will get "things" more intuitive for the users...

I know I can extract some preview information from a specific part - by using the function X.GetPreviewImage(w As Integer, h As Integer, px As Integer()) )
But the only way I know on how to display a bitmap in BlockStyler, is pointing to a bitmap - either entire filepath to a *.bmp in OS system , or simply the string name, of one of the internal NX bitmaps..

But in my wanted scenario, I just want to display a Bitmap tempoary in the BlockStyler dialog - without first creating and saving the bitmap...

Feel free if you have any ideas or comments...

thank you...

regards Lklo






 
Replies continue below

Recommended for you

You have to keep in mind that a preview will only be generated while saving the part.This means for new parts there is none until it is saved.
This you have to catch in your code. No idea if there is an object in the Blockstyler which can show this preview (instead of a bitmap).

Ronald van den Broek
Senior Application Engineer
Winterthur Gas & Diesel Ltd
NX9 / TC10.1.2

Building new PLM environment from Scratch using NX12 / TC11
 
Hi -
Yeahh - You are right...
Just like inside NX ootb, a preview in Assembly navigator, is also not avaibale, if the parts haven't been saved yet...

In my current project, this will not be that major problem...
We do have some information that shall be assigned the Model Parts "very late" in the design process... Some times first - when 2D specifications is under construction...
This is also one of the reason, that I am developing a custom tool, that will make users able to assign or change Model attributes across the active session , without changing display or workpart...
(Model Attributes to be used as argument in differents PartsList's on specifications..)

Simply select a Node in Tree List and already assigned Model attributes will be displayed for users in the input fields....
The Get & Set functionallity is very usefull and intuitive in this situation...

(I did manage to develop a code snippet, that can transfer the Assembly Structure into the Tree List - a bit tricky - but works perfect...Even though I do assume, user will most of time just hit the "Flatten to Models only"....

I will a bit a later on in project - try figure out about if some kind of a "preview can be extracted" from the parts, and generated temporary on the fly....prepared for preview window in dialog...

lklo



 
 https://files.engineering.com/getfile.aspx?folder=4cd38aa5-ad1b-4c0d-9af9-1b221e22e647&file=preview_in_BlockStyler.JPG
Hi lklo

Can you share this segment of code.
Because a time ago I tried to
Work with tree function and failed
because I don't find an example to
Go with and the nx doc is little
In this issue.

Thank you in advanced.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor