PDA

View Full Version : Drawing List via API



ron.sanpedro
2007-01-12, 12:37 AM
I have a client that demands that every sheet include "Sheet X of Y". I have added a Shared Instance Parameter of "Sheet Position", and added a label in the Title Block family. And I have a Drawing List that sorts properly. Now I am wondering, can I use the API to step thru the Drawing List and modify the Sheet Position parameter for each sheet, but only for those sheets that are in the Drawing List?
Also, is there any way to add to Project Information with the API? I would like to have my app also total the sheet count and change the Project information value, which would be reflected in the title block. I could do it as a type parameter of the title block, but that seems to be a kludge, and wouldn't work if we wanted a different look to the cover sheet, but the client still required that the cover sheet say "Sheet 1 of XXX". An additional Project Information item would address both issues.

Crossed fingers, and thanks!
Gordon

GuyR
2007-01-12, 01:03 AM
. Now I am wondering, can I use the API to step thru the Drawing List and modify the Sheet Position parameter for each sheet, but only for those sheets that are in the Drawing List?
Yep, sheets are available (view).


Also, is there any way to add to Project Information with the API?
Yep, bind as per example in SDK. Not necessary for this though.


I would like to have my app also total the sheet count and change the Project snip.,., but the client still required that the cover sheet say "Sheet 1 of XXX". An additional Project Information item would address both issues.

Just add the parameters (sheetNum, sheettotal) to the titleblock as instance parameters and walk the sheet list you already have in memory. Then you can decide to not set cover sheets if necessary for other rclients. Certainly no need to export to Excel as you mentioned in the other thread.

HTH,

Guy

Danny Polkinhorn
2007-01-13, 01:00 AM
I have a sample from last year's AU class that will count sheets so you can do "Sheet 1 of X" type labels on your drawings. It was written for 8.1 so you'll have to update it. It's attached here.

tanks
2007-01-31, 09:29 AM
Hi!

How this script rebuilt for Revit Structural 4?

GuyR
2007-01-31, 10:47 AM
Structures 4 is equivalent to Building 9.1.The simple solution is remove the reference to the RevitAPI.dll in the existing project and reload the API assembly from the structures program directory.Make sure to set the RevitAPI.dll local copy to false under properties. Then recompile.

There have been large API changes since 8.1 so you may need to change some code.

Guy

tanks
2007-01-31, 10:59 AM
I try via Visual basic compile this script, but they show some errors.

I`m not known much in programming languages.
How can I find some short descriptions how made script for structure 4?

My goal is made script, who seek in framing elements properties largest mark, and generate for not marked elements, new unique marks from largest.

GuyR
2007-02-01, 01:39 AM
I'd suggest getting a good book on VB.NET or do some tutorials online. The error is because the method signature for calling Revit commands changed from V8 to V9. You need to implement the IExternalCommand interface Execute method correctly.