cancel
Showing results for 
Search instead for 
Did you mean: 

UDO\Drafting

Experimenter
Experimenter
Hello averybody, I'm trying to investigate the abillity by UserDefinedObject (UDO) to create my custom drafting elements/symbols (like a "Surface Finish"). I found the example of UDO (%UGII_BASE_DIR%\UGOPEN\SampleNXOpenApplications\.NET\UDO) and there was a question: this example create UDO, but it do not able to select in drafting mode. Help me with select the UDO object in Drafting mode. Thanks.
4 REPLIES

Re: UDO\Drafting

Esteemed Contributor
Esteemed Contributor

To a large extent (there are a very few exceptions) the NX API does not care what module it is in.

To work in "drafting" just open/display a drawing sheet.

 

Note for the example of a surface finish, (before I assume) have you already tried using the Siemens supplied surface finish symbol?

I would also investigate using a custom symbol for this.

(Upgrades are easier the less API code you have to deal with)

 

But if you do use a UDO, one suggestion I would have is to add an integer parameter for "version" (i.e. the version of the UDO itself).  Because you'll release your code to production users, then someone will need an additional parameter (or 5 or 10), so you add it, but now your code will have to handle old UDO instances (without the extra data) as well as new ones (with the data).  For your program logic, it is typically easier to just check the "version" parameter to handle the different cases, or upgrade "old" UDOs to the latest "version". 

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: UDO\Drafting

Experimenter
Experimenter
Ken_A, thanks for help. I think the UDO in Drafting mode is an exception, i can't find any way to select existing UDO object in drafting app. The same problem with Edit callback (myUDOclass.AddEditHandler). I have got one more question: how to select a "drafting line" through code? I tasted many variants of Selection.MaskTriple (method UI.GetUI().SelectionManager.SelectObject()), but can't get the instance of object.

Re: UDO\Drafting

Phenom
Phenom

To select objects in a drafting view (such as a drafting line), you'll need to use the .SetCursorView method. I think it defaults to the work view, which is the drawing sheet. Using .SetCursorView(0) will allow selection within any view (drafting view or sheet).

Re: UDO\Drafting

Experimenter
Experimenter

Thanks for all tips very much.

 

PS: A helpfull article of GTAG: https://solutions.industrysoftware.automation.siemens.com/view.php?sort=desc&dt=nx-api&q=udo+draftin...