c++ revit api. Getting element categories from model.

c++ revit api. Getting element categories from model.

halukuzuner
Advocate Advocate
1,075 Views
6 Replies
Message 1 of 7

c++ revit api. Getting element categories from model.

halukuzuner
Advocate
Advocate

Dear friends. I am new to Revit API world. I am trying to get element categories from model but I get following error. Can someone help me to get over this problem? Visual C++ project is also attachedç

 

halukuzuner_0-1608320522924.png

 

 

0 Likes
1,076 Views
6 Replies
Replies (6)
Message 2 of 7

joshua.lumley
Advocate
Advocate

Revit API works with C#, Python, VB & Ruby.   Most almost everybody in this forum use the .net framework with C#.

 

To get a list of all the categores use: doc.Settings.Categories

 

0 Likes
Message 3 of 7

halukuzuner
Advocate
Advocate

Yes it seems only fewer people use C++ for revit API. I only know C++. so that I am trying C++.

0 Likes
Message 4 of 7

joshua.lumley
Advocate
Advocate

I don't think the learning curve is as steep as you imagine. Just start with Taskdialogue.show("Me", "Hello World");  It will only take you a few days to pick up speed because c# is easier then c++ and the projects compile lightning fast.

0 Likes
Message 5 of 7

halukuzuner
Advocate
Advocate

I have already done "hello revit" addin. It works fine. But my problem is accessing model elements from the form wihich I created.

0 Likes
Message 6 of 7

joshua.lumley
Advocate
Advocate

Try accessing just one with the element ID and the document. 

Element myElement = doc.getElement(new elementid(12345));

 

0 Likes
Message 7 of 7

halukuzuner
Advocate
Advocate

Dear Joshua,

Thanks for your replies. My problem is accesing cached "CachedDoc" variable from "MyForm.h". If I could acces that document from MyForm I will be able to use the syntax you mentioned. Revit API.png

 

0 Likes