« RvtMgdDbg for Revit 2010 | Main | Adding a Column to RDBLink Export »

October 30, 2009

Comments

Hi Jeremy,

I was hoping you can help me with an issue I am having with the Revit API. I wrote a printing application for Revit that my company uses for billing purposes. One of the requirements of the application was to allow users to print to devices that are not connected to their computer when Revit starts. I am able to do that using the SelectNewPrintDriver() method in the PrintManager and give it as a parameter the network location of the desired device ("\\server\queue"). My issue is that this method takes forever the first time I connect to a particular device, sometimes it takes as long as 30+ seconds for the method to complete. Can you give me any advice on how to speed the execution of the method?

Dear Ivan,

Have you checked whether the same behaviour occurs if you select the printer through the user interface instead of through the API? From what you say, I suspect that this may be the case. If so, you could turn to product support and ask them. They probably have a solution which has nothing to do with the Revit API. I am pretty sure that there is nothing in the Revit API that you could use to improve this programmatically, anyway.

Cheers, Jeremy.

Blogs are so informative where we get lots of information on any topic. Nice job keep it up!!

Dear Jeremy ,

Please help me with an issue I am having with the Revit API. How can i access SystemVariable like in autocad GetSystemVariable("insunits") to get unitMuliplier.

Dear Bhavana,

You cannot access any system variables in Revit because no such thing exists.

For the display representation of units, please refer to the Revit SDK sample ProjectUnit, which lists all units in the current project and displays their format information.

Cheers, Jeremy.

Drawing a polygon around a floor,
Hi Jeremy ,
I am looking for the best way to draw a polygon from Model lines or detail lines around a floor. I tried to do that by getting the floor's corners and adding an offset (for example 2 m) to them. Until now I can do that only for rechtangel floors, that are parallel to coordinate axises. With other shapes will be my method very comlex because I have to take the different angels into the account. I hope that it is possible to lose this in another simpler way.
My best wishes
Habib

Dear Habib,

A present for you:

http://thebuildingcoder.typepad.com/blog/2008/12/3d-polygon-areas.html

Cheers, Jeremy.

Hi Jeremy,
thank you very much for the present but i think i have to simplify my question. My question in other words is: How to create parallel model lines to exicting Modellines (or to roof's edges).
P.S. this have to be done only in 2D

Dear Habib,

That is indeed simple question. The answer is simple as well. You can either calculate the model line start and end points yourself, offsetting the original curves endpoints perpendicularly to the line, or you can use the Revit API Curve.Transformed property to create a curve offset by a specific direction.

Cheers, Jeremy.

Hi Jeremy,
Thanks a lot. I found it :)

Dear Habib,

Great, congratulations, and thank you for the good news.

Cheers, Jeremy.

Hi Jeremy,
Line.Direction Property Returns the direction of the line as XYZ (sinA, cosA,0)(in 2D).A have to be an angel with North (I think so but i m not sure).
My quastion is: what is exactly the direction of a line in revit API?
Cheers, Habib

Dear Habib,

I do not quite see the sense or purpose of your question, but here goes anyway:

A line is a geometric concept connecting two points. You can consider one the start and the other the end point.

If you keep track of this difference, you in fact have a directed line.

In Revit, the start and end points are distinguished by their index, which is 0 for the start and 1 for the end point.

I would consider the direction of a directed line to be the vector from the start to the end point, possibly normalised, e.g. for a Revit API Line object instance L:

XYZ startPoint = L.get_EndPoint( 0 );
XYZ endPoint = L.get_EndPoint( 1 );
XYZ direction = (endPoint - startPoint).Normal;

I hope this helps.

Cheers, Jeremy.

Jeremy,

I have an idea for an open source.project on sourceforge. I am new.to creating sf material so it may.take a.while to get it running.right. link is here for anyone wishingng to collaborate:

https://sourceforge.net/u/apsis0215/profile/

If that is not it email me at [email protected].

Dear Ron,

It would help if your sourceforge profile would be more specific on what this is all about.

Cheers, Jeremy.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Your Information

(Name and email address are required. Email address will not be displayed with the comment.)

Jeremy Tammik

AboutTopicsIndexSource