Snake? Why the need for all the secrecy? It doesn't take a genius to realize that you mean python....
Perhaps not a genius but how many non programmers know what python is other than as a snake? Those that knew what I was attempting understood. That was my target audience. I was just having some fun....
For me Python is to programming what Revit is to Architectural documentation. Making the difficult things as simple as possible, giving you more time to concentrate on the design. To bring the two together is bloody exciting I reckon. And I'll show you why soon....
I can definitely say it's working and seems to be working well so far although it's early days.
In Python:
Code:
for elem in allElements:
if elem.GetType() == a.GetType("Autodesk.Revit.Elements.Wall"):
walls.Insert(elem)
In C# (it'd be uglier in VB)
Code:
foreach (Autodesk.Revit.Element elem in ss)
{
if (elem.GetType() == typeof(Autodesk.Revit.Elements.Wall))
{
{
walls.Insert(elem);
}
}
}
Umm, I'd rather see you exercise a certain different interface.
Fedor, I think this is what you're referring to...
The problem is AFAIK I can't pass a string from the ini file to load a particular python module. Thinking about it, having a list of scripts to run is easier for the novice anyway and only a few more mouse clicks. The list of scripts to run will be generated from a parsed directory so to add a script just drop it in the relevant directory.
For those that want it I can release a dll that uses a fixed script name. So different scripts would have to be in different directories. And you could use the ini file as intended.
I'm open to ideas on all of this. At the moment the priority is just getting things tidied up , playing more with the API, understanding exception handling/ testing and sorting out a few issues that affect installation.
More examples to come in the next few days...
For those who want to know more about python go to www.python.org.
Guy