Alien
November 15, 2023, 11:39am
1
I gave up with the task dialog and went to winforms…
But have now discovered the Py3 in Dynamo is more long winded!!
Greyed out was the old code from IronPython and the ungreyed code is what I have to put now.
BUT… I can’t seem to set the font style. I just get an error if I place it in the Font brackets. Any idea?
I’ve tried several variations.
Alien
November 15, 2023, 12:02pm
2
label.Font = Font(“Arial”, 12, “Bold”)
label.Font = Font(“Arial”, 12, Font.Style.Bold)
label.Font.Bold = Font(“Arial”, 12)
label.Font.Style.Bold = Font(“Arial”, 12) {getting desperate}
label.Font= Font(“Arial”, 12, Style.Bold)
label.Font= Font("Arial", 12)
label.Font.Style = "Bold
label.Font= Font.Style(“Arial”, 12, FontStyle.Bold)
label.Font= Font(“Arial”, 12, FontStyle.Bold)
All of the above give errors…
Then some variations don’t give errors but do nothing.
label.Font = Font("Arial", 12)
label.FontStyle = ("Bold")
Hi, by looking at Mr. Poupin’s article with SharpDevellop you have access to the code
Sincerely
christian.stan
self._label1.Font = System.Drawing.Font("Microsoft Sans Serif", 12, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0)
2 Likes
Alien
November 15, 2023, 2:42pm
4
Thanks, I’ll check that out.
I just closed it in frustration!
I can’t seem to get anything but the most basic things to work!
I want to know why it’s not like actual Python!
1 Like
Sorry for not doing better, 100% true python, I still have big gaps
cordially
christian.stan
Alien
November 15, 2023, 3:27pm
7
Can’t say I’m overly enamoured with the ‘upgrade’
In my experience when there is a security driven update the coders suffer more than end users; doubly so when the update forces you to change multiple items at once (Python Engine and Python version).
For what it’s worth, this will make your inevitable evolution into C# easier…
1 Like
Alien
November 15, 2023, 3:40pm
9
My ‘evolution’ to C# is going painfully slow…
Think a geriatric snail who keeps getting sidetracked.
Everyone moves at their own pace. Some jumped quickly (Konrad Sobon). Some may never leave Python (Andreas Dieckmann). I just built my first “real” package with it this fall.
Don’t look to others, but focus on your needs and end goals.
Alien
November 15, 2023, 3:50pm
11
I made an add-in for Revit with some fun images (bunch of useful company links)
I keep meaning to add more stuff… But the side tracked thing is a huge issue.
1 Like
The problem does not come from Python3 (IronPython3 has no problems at this subject) but from the version of PythonNet currently used
PythonNet 2.5 vs PythonNet 3.0 example
if there is no solution in the future, maybe a C# script OTB interpreter node might be welcome
2 Likes
If you have it compiled in C# you can just load in the DLL… that said a series of common iInterfaceThing nodes might be a good addition to Dynamo for Revit, to allow users to pass them as inputs into Python nodes…
I was thinking more of a solution like this
If you’re testing something specific, you could always give my Dynamic CSharp Interpreter a go:
[image]
You can find it on the package manager
I think both solutions have advantages,
2 Likes