Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Please help to understand the Blockstyler "Static APIs for block property"

Status
Not open for further replies.

Ehaviv

Computer
Jul 2, 2003
1,012
hI IN NX11 blockstyler help that atached in this post
I understand that for all blocksID I can use the static methods
and not getproperties and propertiesnames.

do I'm right ?

Code:
[b]Static APIs for block property[/b]
NX Block UI Styler provides Static APIs to get and set block properties. 
The Static APIs are available for: 
•NX Open for .NET: NXOpen.BlockStyler namespace in NXOpenUI.dll 
•Java: nxopen.blockstyler package in NXOpenUI.jar 
•NX Open for C++: NXOpen::BlockStyler namespace in libnxopenuicpp.dll 
•Python: NXOpen.BlockStyler module for NX Open 
Use Generate Block Specific Code  for block specific code generation during dialog box design time when you use the Static APIs. The default value for Generate Block Specific Code  is True. 
Example  
[b]VB.net code for an integer block with BlockID as integer0[/b]:
 
Private integer0 As NXOpen.BlockStyler.IntegerBlock
integer0 = CType(theDialog.TopBlock.FindBlock("integer0"),NXOpen.BlockStyler.IntegerBlock)

[b]integer0.Value[/b]  will return the Value property of this block. 
To set the Value property of this block, the code should be: 
[b]integer0.Value = 500[/b]
To get the Value property of this block, the code should be: 
[b]Dim val as integer  = integer0.Value[/b]

hlp_dafcxv.jpg
 
Replies continue below

Recommended for you

Yes, you can use the "static" API to get or set all block properties.

I think this is far better than the old "dynamic" API, because you get good Intellisense support in Visual Studio and other IDEs. As soon as you type the block name and a period, you get a list of the available properties. You don't have to remember any magic strings to handle properties.

In SNAP, there is no dynamic API, only a static one. The block properties in SNAP are almost all the same as in NX/Open, and they're better documented, so you might find the SNAP documentation useful.
 
Thank you very much BubbaK

What if use nx journal editor
to build my blockstyler journal
using vb.net.

its also ok.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor