« Top Faces of Sloped Wall | Main | Revit API Training Material »

July 26, 2011

Comments

Hello Jeremy Tammik

In here, I want to ask some question about the workset in Revit Architecture 2011.

when I create the workset in revit 2011, and I can set the specific workset visible or hidden in the view.

if I set the specific workset hidden, How can I get the element in the workset that is set to be hidden in the view.

I know that in revit 2012 ,it provide some relative method to resolve thie question, but in revit 2011 , I can't find them!

Therefor, I hope you can give me some example code which how to get the element in workset by RevitAPI 2011.

Best Regards
Ian

Dear Ian,

These methods are new in Revit 2012, and are not available in Revit 2011.

Cheers, Jeremy.

Thanks!

But I want to ask whether it exists other methods to find the element in workset in Revit 2011?

Dear Ian,

Not as far as I know, sorry.

Cheers, Jeremy.


Hello sir,
I am getting problem to get a real time view(like in case inserting door on a wall,after selecting the door, i am not getting the door view of moving along with the mouse cursor only getting cursor and if click on wall directly it will inserting.) before placing family inserting.

my code is like this:

public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
..........
try
{
trans.Start();
Family family = null;
FamilySymbol symbol = null;
if (doc.LoadFamily(@h4, out family))
{
foreach (FamilySymbol s in family.Symbols)
{
symbol = s;
}
View view = uidoc.ActiveView;
Reference r = sel.PickObject(ObjectType.PointOnElement, "Select");
Element elem = doc.GetElement(r);
Wall wall = elem as Wall;
XYZ globalPoint = r.GlobalPoint;
XYZ levelPoint = new XYZ(10, 10, 1);
Wall wall = doc.GetElement(r) as Wall;
FamilyInstance instance = doc.Create.NewFamilyInstance(levelPoint, symbol, wall,level,StructuralType.NonStructural);
}
trans.Commit();
}
catch (Exception)
{

}
return Result.Succeeded;
}

Hello Jeremy!
Could you give me please your advice in next problem:
I have a big model with several linked files. One of this link is reflected (mirrored)3 times in different directions.
I need to convert this model to other format, so I'm getting all links, their transformation and then convert each linked model (processDocument method):

foreach (RevitLinkInstance linkInstance in _doc.GetInstances(_app.Application, false))
{
Transform transform = linkInstance.GetTransform();
if (transform != null && transformCoordinates)
LinkedDocumentTranslationHelper.SetParentTransform(transform);
processDocument(linkInstance.GetDocument(...));
}
But I can't get reflections. Should I do reflection manually, if so - where can I get infor about reference plane for linked model with flag HasReflection = true.

Thank you,
Olga

Dear Olga,

I cannot say off-hand, so I am asking the development team for you.

One other thing you might try, though, depending on what you are exporting, and how and why:

Use the custom exporter framework.

It includes data for linked files.

In fact, it includes everything that you see on the screen, honouring your view specific setting:

http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.1

Cheers, Jeremy.

Hi Jeremy!
Thank you for advice.
I've found the reason of my problem. It was absolutely in other place.
I was wrong when thought, that property HasReflection means that current link HAS reflection, in fact it means that link IS reflection.
The reason for the disappearance of the mirror links was very easy - they just had the same name of file and were overwritten during storing.
Sorry to trouble you.

Thanks,
Olga

Dear Olga,

Congratulations on solving it, and thank you for letting us know.

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