« RoomsRoofs SDK Sample | Main | Filter Performance »

October 01, 2008

Comments

Hello Jeremy, what is the error?

I create a level and then new wall and a door and It draw the 2 objects in diferent levels.

Level nivel0 = doccreation.NewLevel(50);
doccreation.NewViewPlan(nivel0.Name, nivel0, ViewType.FloorPlan);

Wall muro1 = doccreation.NewWall(linea1, nivel0, true);
FamilyInstance fi = doc.Create.NewFamilyInstance(midpoint, door, muro1,nivel0, StructuralType.NonStructural);


Thanks

Dear Berria,

I cannot tell you off-hand what the problem is in your situation, but I can provide you with a code example that achieves your goal. Look at the external command Lab2_0_CreateLittleHouse in the Revit API introduction labs, which are available at

http://thebuildingcoder.typepad.com/blog/files/rac_labs_20081117.zip

Cheers, Jeremy.

Hello Jeremy,
I need create a house with 2 floor, when I built the first is all OK, and the error is when I build the second, because de level to start the componet posicion is always 0.

Best regards

Hi Berria,

I cannot really dive deeply into this, but I have rewritten the code I pointed you to above to create two sets of walls on two levels, with a door in each set. I have posted the new code in a separate post:

http://thebuildingcoder.typepad.com/blog/2009/01/walls-and-doors-on-two-levels.html

You need to ensure that the Revit model has three levels, and that they come in the expected order, for my simple test command to work. Please appreaciate that I do not have any more time to spend on this now.

Cheers, Jeremy.

Hi Jeremy,
Thank you very much, I create my walls and component with your code.
Now I have problem with a level of the floor, I apply the similar code in roof and its Ok, can you say me where is the error??

Level levelBottom = doccreation.NewLevel(0);
Level nivel1 = doccreation.NewLevel(15);
Floor floor1 = doc.Create.NewFloor(profile, floorType, nivel1, false);
FootPrintRoof roof = doc.Create.NewFootPrintRoof(profile, nivel1, roofType, footPrintToModelCurvesMapping);

The result is, floor posicion in the bottomlevel and roof in nivel1, I dont understand nothing.

Very, very thanks

Hi Jeremy,
Thank you very much, I create my walls and component with your code.
Now I have problem with a level of the floor, I apply the similar code in roof and its Ok, can you say me where is the error??

Level levelBottom = doccreation.NewLevel(0);
Level nivel1 = doccreation.NewLevel(15);
Floor floor1 = doc.Create.NewFloor(profile, floorType, nivel1, false);
FootPrintRoof roof = doc.Create.NewFootPrintRoof(profile, nivel1, roofType, footPrintToModelCurvesMapping);

The result is, floor posicion in the bottomlevel and roof in nivel1, I dont understand nothing.

Very, very thanks

Hi Berria,

I don't understand nothing either :-)

Looks to me as if you are creating the floor and the roof in the same level 'nivel1'?

Cheers, Jeremy.

Sorry, the code is this:

Level levelBottom = doccreation.NewLevel(0);
Level nivel1 = doccreation.NewLevel(15);
Level nivel2 = doccreation.NewLevel(30);
Floor floor1 = doc.Create.NewFloor(profile, floorType, nivel1, false);
FootPrintRoof roof = doc.Create.NewFootPrintRoof(profile, nivel2, roofType, footPrintToModelCurvesMapping);

The result is, floor posicion in the bottomlevel and roof in nivel2.

Hi Berria,

Maybe you can try changing the Z coordinate of the profile before adding the second floor?

Cheers, Jeremy.

Hey Jeremy.

How can I get the id of the host using VB code please? I'm currently getting the host name like this:

param = elem.get_Parameter("Host")
writetagline("host", param.AsString)

(writetagline is a function I made that exports the name to an external .xml file.)

But what I really need is the id of the host.
Thanks!

Hi Nicholas,

As you can see it in the above code sample if the element is actually a family instance, then you can get to its host's id like this: "ElementId idHost = fi.Host.Id;"

Am I missing something? :-S

Cheers,
Adam

Hey Adam,
I'm such a noob!

I managed to get the Host name and id like this:
Dim fi As FamilyInstance = e
MsgBox(fi.Host.Name.ToString)
MsgBox(fi.Host.Id.Value.ToString)

Thanks for pointing me in the right direction!
Nicholas

Hi Jeremy,
I've a question about "Doors Direction" and I don't know where should I post this question. So sorry if it's the wrong place for it :-)
Now my question: How can I find out in which direction doors will be opened? A unit vector like (0,1,0) will be also a good solution for me.
DANKE!
puyan

Dear Pyan,

Please have a look at the DoorSwing Revit SDK sample and the "Revit 2010 API Developer Guide.pdf" document, especially section 10.3.1.1 Orientation, Figure 56: Doors with different Facing and Hand Orientations, and Table 26: Different Instances of the Same Type.

Bitte sehr and 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