GUI in City Engine using Python

3680
10
08-03-2012 12:17 AM
RamliJannatul_Alia
New Contributor
Hi Matt, as your request. here i open new thread for GUI in City engine using python. THANKS!
Tags (3)
0 Kudos
10 Replies
MatthiasBuehler1
Frequent Contributor
Hi !

I found the little example. See attached file.

It calculates the length of a selected graph segment.

You may notice that CityEngine uses Jython, not Python.

Hope this gives you a good start.
0 Kudos
JussiViinikka1
New Contributor
Hey,

Im having problems running this. I tried to run it from Python->Run Script and adding it and running it from the Scripts menu, and running it from the console (after sys.path.append("location"). Any ideas what I'm doing wrong?

-Jussi
0 Kudos
MatthiasBuehler1
Frequent Contributor
Hi !

What are the problems ?

Do you get errors in the Log Window ?

What does the stack trace say if you double-click the errors ?



Let me know ..

Matt
0 Kudos
JussiViinikka1
New Contributor
hi,

No errors no nothing. If I run it through Python->Run Script nothing happens. If I run it through the Scripts menu I get a pop up window saying "Running /folder/measureStreetLength.py" which then disappears and then nothing. Might it be the fact that my workspace is in c:\users folder and im running on finnish windows 7 which autotranslates "users" to the finnish equivalent in some manner which might then result in the scripts in that folder not working?
0 Kudos
MatthiasBuehler1
Frequent Contributor
Hi ..

Sometimes, the windows hide behind the main CE GUI ..

Does this help ?


I'm usually happy if they start via F9. I never use the console.
0 Kudos
AndreasUlmer
Esri Contributor
Hi Jussi

I'm sure you checked that, but just in case: these dialogs might appear "behind" the open CE window.


Might it be the fact that my workspace is in c:\users folder and im running on finnish windows 7 which autotranslates "users" to the finnish equivalent in some manner which might then result in the scripts in that folder not working?


could be. can you try the following:

* create a new folder C:\addscripts\
* copy measureStreetLength.py into that folder
* in your CE project, File -> New... General - Folder
* folder name : addscripts
* choose advanced - link to alternate folder, browse to C:\addscripts
* open the new linked folder, open measureStreetLength.py, Python -> Run Script
0 Kudos
AndreasUlmer
Esri Contributor
I did find an updated version of that script. same general behaviour, but slightly update UI.

[ATTACH=CONFIG]23543[/ATTACH]
0 Kudos
JussiViinikka1
New Contributor
Hello,

It was indeed hidden behind all the windows I had open, not just the CE one. So they dont always appear there? Any solution to this behaviour? As it is, they dont just appear there, they remain there (every time you activate CE screen they go to the background again) which makes using them a bit problematic 🙂

-Jussi
0 Kudos
MatthiasBuehler1
Frequent Contributor
Hi !

There's noting really we can do about this right now. Best, move the GUI a bit to the side..

Ok ?
0 Kudos