PDA

View Full Version : Revit scripting



clog boy
2007-11-29, 12:39 PM
Hi, I've seen a few Revit scripts, heard about Revit API's and have some PHP experience.
How hard is Revit scripting? (example the Revit render benchmark file) What scripting/programming language does it most closely resemble? I know my way around variables but have less experience with writing functions or other object oriented programming.

What I want my script to do:
- check for groups and corresponding detail groups to become active
- copy-with-detailing and rename specific views
- create and name sheets

In other words, standard operations, specifically contect menu actions and property manipulation.
I wasn't able to teach myself C# programming, PHP took a while but JavaScript doesn't look too complicated and I don't expect many dificulties learning Perl.

Suggestions apreciated.

aaronrumple
2007-11-29, 02:31 PM
no script language. What you have seen others use is a journal file. Journals files are a debug log Revit creates while running. It is not intended as a programming language and is undocumented and unsupported.

There is an API that uses .Net. You can write code using that, but it was really designed for interacting with external programs. It is pretty new and not as complete as something like MaxScript.

As for your specific tasks – The create and name sheets should just be a part of your template. You set them up there and when you start a new project they are ready to go. Just delete the ones you don’t need. Heck – even set up all the standard details so they are done.

If you want to make sure that all groups have the associated detail group applied – just right-click over one group and do a select all. Then go to the place detail tool and check the detail you want placed.

I’m not sure copy with detail and doing a rename will save you any time. Don’t you still need to type in the name at some point? If they are standard views you use on ever project – make them a part of the template.

clog boy
2007-11-29, 03:06 PM
We have four template files, all containing a fullblown model. That's because we build prefab homes - the construction is placed within two days, the roof arrives on day three (prefabricated by us) and the house is wind- and watertight in five days. All that needs doing is all MEP things and place a brick wall around it. In average, we're completing one or two houses each day. Total construction time for let's say 50 houses is less than a year.

So right now we're upgrading our models, call it a complete overhaul because we decided to no longer outsource our CAD work.

There's a few things to worry about. We're rebuilding all views and sheets from scratch, now that our models are up to spec. So we need all files to have consequent naming of views and sheets, and make sure they all have the right view template.

We offer a number of options for variation, such as a garage, a carport, a home extension (+1200 or +2400), etc. Those are embedded as groups. All groups need to be switched on or off without breaking them. Building permit is based on the maximum number of options, while address-specific drawings are made based upon customer's choise. So we also need to check each view whether the right attached detail group is active or not.


Can you see why I want to script certain work? It's the boring and tedious repetitive grinding I want to automate. This is to keep me from losing my sanity, to speed the process and to make sure everything is done the same way all the time. To make it worse, we hire an architect for each project to design our masonry.

aight enough rambling about my daily agony. Revit doesn't officially support scripting? Back to teh boring old fault-prone grinding then...

sfaust
2007-11-29, 03:20 PM
If it's that specific you may want to look at the API. I know you said you didn't get C#, but you can program in VB.net with the API as well. If you've got the same view template names and view names all the time as well as group names, etc it may not be too hard to do...

clog boy
2007-11-29, 03:22 PM
Forget it, if it's going to be more complicated than PHP I'm pretty much lost.
Luckily view templates can be transfered between projects.

aaronrumple
2007-11-29, 06:34 PM
[quote=bram.weinreder;785334]
We offer a number of options for variation, such as a garage, a carport, a home extension (+1200 or +2400), etc. Those are embedded as groups. All groups need to be switched on or off without breaking them. Building permit is based on the maximum number of options, while address-specific drawings are made based upon customer's choise. So we also need to check each view whether the right attached detail group is active or not.
quote]

Design Options.
Just set them all up and have all the variation right in the model. You wouldn't need to fool with groups then. Just print the sheets for the particular option. You may need to replace the sheet number parameter with plain text so you can have several A-1 sheets, but that's no big deal. Or develop a naming system that takes into account the options.

clog boy
2007-11-30, 07:43 AM
Well, see... you can't nest design options. Additionally, we heard groups have been improved greatly so we decided to give it a try and we haven't been proven wrong yet.

The total number of possible combinations is absolutely huge, while the total number of elements is not too complex. The attached PDF files demonstrate this. The 2d file shows a matrix of the most often purchased options, while the 3d file showcases the outcome of some of these combinations.

You also remember me mentioning something about attached detail groups, right? You can't add detail components to a design option so that's another motivation to use groups instead.


Our models are up to spec. But it's quite a lot harder to make them user- (and resource) friendly. I like to think that what we've been doing has never been done before. So it's hard to imagine how other people would actually use our models.

vennix
2007-11-30, 08:31 AM
To make it worse, we hire an architect for each project to design our masonry.


And these architects...
Do they use revit too?
I would be very interested to see how this collaboration works.

Cheers,
Geert

clog boy
2007-11-30, 10:55 AM
They don't, we send them .dwg exports of the 'clean' drawings. Then they print that, and get to work with their pencils, we get the sketch and try to implement that. This usually takes a few hours.
Once we're done we mail them a screenshot of the 3D model and the architect comments on it. Repeat until deadline.

We keep an eye on each other's work, so the margin of error is kept to a minimum.

aaronrumple
2007-11-30, 02:48 PM
Well, see... you can't nest design options. Additionally, we heard groups have been improved greatly so we decided to give it a try and we haven't been proven wrong yet.
.

I don't see anything in your sketches that would preclude using design options and no reason you would need nesting.

From what I see you would work it this way. Lets say you have house with Garage A, Garage B and the base option is no garage. Set up an options set called Garage. Then create 3 options. Blank, Garage A, Garage B. Blank is the primary option (or base model.) Of course you can have as many variations of the garage as you like.

Then you do the same for porches. Blank, Porch A, Porch B, etc.

Next create a view for each combination of options. Maybe Base + Porch A, Base, + Garage A + Porch B, etc.... Turn on the options you want for each design in each view. Dimension and note each design in that view. No need for attached details and the management required for attached details. Each set of design options has its own view and hence its own details, notes and dimensions. Editing and corercting notes will be much simpler.

Each time you come up with a new variation, you copy/paste some stuff from one design option to the new one. Edit. Note. Print. Save for next time. And no need for scripting or manual updating of anything.

clog boy
2007-11-30, 03:07 PM
Sorry Aaron, I'm pretty much convinced groups are more convenient to work with. Perhaps you're a bit traumatized from how they used to work.

We decided on using groups, because they can be combined more easily than design options. You can only use one design option per set per view, while groups can be combined endlessly. We put a lot of time and effort into making the groups, and they work. It works better than any alternative I can come up with. It's just the boring part of the job I can do without.

In short, using design options isn't an option anymore. We've long since past that point, and we would make the same decision again each day. We also learned from dealing with phases, that we would want design decisions to be visible throughout the entire file instantly. More important, we decided to drastically minimize the number of views. It's a proven fact that less views increase productivity so each unrequired view is costing us time, frustration and money.

aaronrumple
2007-11-30, 04:01 PM
Sorry Aaron, I'm pretty much convinced groups are more convenient to work with. Perhaps you're a bit traumatized from how they used to work.

Funny. I've been pushing groups hard since they pre-Autodesk. I used to do multi-family low rise town homes where we would be doing exactly what you’re doing. I've done it several different ways. My preference remains design options. And I can attest that it eliminates the boring work you have to do. So been there - done that.

Now I'm doing hospitality and gaming on 400 - 600 room hotel towers. After that, doing groups for homes is simple stuff.

(...btw, design options are just groups under the hood of Revit. ;-) )