Execute function Get name solid when select on solid in multi solid parts

Execute function Get name solid when select on solid in multi solid parts

ngocson8335
Advocate Advocate
550 Views
3 Replies
Message 1 of 4

Execute function Get name solid when select on solid in multi solid parts

ngocson8335
Advocate
Advocate

Dear Expert,

 

I just create a Dockable Window and put a textbox on it. I want it automatically gets a solid name when I select on the solid. How can it execute the GET NAME SOLID Function instead of click on the button?

 

Here is the dockable window:

Execute Funtion.png

 

Many thanks

Ngoc Son
Autodesk User
0 Likes
551 Views
3 Replies
Replies (3)
Message 2 of 4

Sergio.D.Suárez
Mentor
Mentor

 

Dim oSolid As Surfacebody= ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartBodyFilter, "Select SolidBody")
	If oSolid Is Nothing Then Exit Sub
		
MessageBox.Show(oSolid.Name)

Hi, try this code, I hope it helps with your problem 


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes
Message 3 of 4

ngocson8335
Advocate
Advocate

With your code, I need a button to run this function?

 

I want to get the solid name without using the push button to start the function.

 

2019-06-29_11-49-18.png

 

Thanks Sir

Ngoc Son
Autodesk User
0 Likes
Message 4 of 4

ngocson8335
Advocate
Advocate

Hello Sir,

 

Can you help me?

Ngoc Son
Autodesk User
0 Likes