Notifications
Clear all

[Closed] on click btn inside dotnetcontrol panel

Thank you LoneRobot. I’m closer and closer.

I now get an error:

Unable to convert: #Multi/Sub-Object:Material #737(VRayMtl:VRayMtl_1, VRayMtl:UI67,…) to type: System.Object <<

I see now, it means, I cannot apply material to tag, that’s why.

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

you can. but you have to use dotnetmxsvalue. search it here and you will find many samples of its using

thank you Denis. Before this I had

	fn select_by_mat_fn sender args =
	(
		theMaterials = for m in btnarray where sender.tag == m[1].name collect m[1]
		select (for o in Geometry where (findItem theMaterials o.material)>0 collect o)
	)

btn.tag = smaterial.name

now I corrected:

	fn select_by_mat_fn sender args =
	(
		select (for o in Geometry where ((dotNetMXSValue o.material)==sender.tag) collect o)
	)

btn.tag = dotnetmxsvalue smaterial

last question: should I extract the value from dotNetMXSValue, or I have to compare (dotNetMXSValue o.material) like I did?

dotnetmxsvalue is dotnet object. the object has a property “value” which is a max value
if you put an array of materials in tag as dotnetmxsvalue, the tag.value is this array.

Denis, I have just found the same:

select (for o in Geometry where (o.material==sender.tag.value) collect o)

thank you so much for your kindness and time

Page 2 / 2