Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

a trouble in select object in .Net VB

Hi

I got a problem that I got the solid body from "select object" UI in Block Styler, and I want use Modl.AskBoundingBox to calculate the size of the solid body, how can I transfer TaggedObject to Tag? Or maybe I have something wrong in below program?

 

Dim body As NXOpen.Tag

Dim taggedObjectVector() As TaggedObject

taggedObjectVector = Me.selection0.GetProperties.GetTaggedObjectVector("SelectedObjects")

 

?????????
Try
UfS.Modl.AskBoundingBox(body, boundingbox)
x = boundingbox(3) - boundingbox(0)
y = boundingbox(4) - boundingbox(1)
z = boundingbox(5) - boundingbox(2)

 

 

Best Regard

Christian

Best Regards
Christian
4 REPLIES

Re: a trouble in select object in .Net VB

Every object has a tag property, so you just use that property, like MyBody.Tag Smiley Wink

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: a trouble in select object in .Net VB

Hi Stefan

I'm still confuse with tag property, can you give me more hint? Thanks in advance!



Best Regard
Christian
Best Regards
Christian
Solution
Solution
Accepted by topic author Christian0313
‎03-21-2016 07:52 AM

Re: a trouble in select object in .Net VB

Dim taggedObjectVector() As TaggedObject
taggedObjectVector = Me.selection0.GetProperties.GetTaggedObjectVector("SelectedObjects")

For Each theTaggedObject As TaggedObject In taggedObjectVector

    UfS.Modl.AskBoundingBox(theTaggedObject.Tag , boundingbox)
    x = boundingbox(3) - boundingbox(0)
    y = boundingbox(4) - boundingbox(1)
    z = boundingbox(5) - boundingbox(2)
Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: a trouble in select object in .Net VB

Hi Stefan,
I got it, I appreciate you could tell me the detail program, thank you so much!!
Best Regards
Christian