Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / MaxScript / dotNet maxscript and controlling fonts??
  RSS 2.0 ATOM  

dotNet maxscript and controlling fonts??
Rate this thread
 
3811
 
Permlink of this thread  
avatar
  • Total Posts: 8
  • Joined: 29 January 2007 08:05 PM

so,
been spending some time looking at how to convert my scripts from active x to dotnet.
so far i feel like the documentation in the maxscript help is a not very funny joke.
anways here’s what i’m stomped on, maybe one of you very sexy brained guys can figure it out, and help a brother out :)

ok, so…
what i’m trying to do is control the font of a treeview, i have figured out how to set the font and the size but style dosn’t seem to work for me. this is the basic contstructor i’m using

myFont dotNetObject "system.drawing.font" (doNetObject "system.drawing.fontFamily" "Tahoma"8.25 (dotNetObject "system.drawing.fontStyle" Bold)

i think the problem is that the “fontStyle” creator is broken.
this is how i have tested it…

--this is the the way you would guess the command is constructed
(dotnetobject "system.drawing.fontStyle" "bold")
--
problem is this crashes
--this line is a bit wi
(dotnetobject "system.drawing.fontStyle" bold)
--
this return an undefined value which makes me assume it it is broken

any ways, I’m probably not even coding this right. any help will be deeply appreciated.
cheers,
Los.



Carlos Anguiano
Technical Director/Digital Artist
Digital Domain
Venice CA

Replies: 0
avatar

ok got it to work.
i guess fontStyle can not be genrated by dotnetobject
by it can be generated by dotnetclass.
this worked for me just in case any one runs into this.

newNode.nodefont dotnetobject "system.drawing.font" (dotnetobject "system.drawing.fontfamily" "tahoma"8.5  (dotNetClass "system.drawing.fontStyle").bold


Carlos Anguiano
Technical Director/Digital Artist
Digital Domain
Venice CA

Replies: 0
avatar

That’s right!
If you check out ”System.Drawing.Font”, you’ll see that “Bold” doesn’t exist Constructor parameter, but exists as read-only Property to set for Style property.



Replies: 0
avatar

See Label control example by Bobo : http://www.scriptspot.com/bobo/mxs9/dotNet/Label.html



Yannick Puech - http://ypuechweb.free.fr/

Replies: 0