API REVIT ARCHITECTURE

API REVIT ARCHITECTURE

Anonymous
Not applicable
1,520 Views
13 Replies
Message 1 of 14

API REVIT ARCHITECTURE

Anonymous
Not applicable

START WITH C # PROGRAMMING FOR REVIT ARCHITECTURE: I tried to do an exercise (file revit_2012_file_training.zip) that involves the creation of rectangular columns.

For this reason we created the class (PICTURE CREAZIONE FAMILYLABSCS.JPG):

C:\TEST\pil\FamilyLabsCS\FamilyLabsCS\FamilyCreateColumnRectangle.cs

I then created the file addin (see picture 0 ADDIN.JPG).
Then I open Revit Arch 2013 and when I click on "PILASTRO" me 'a mistake or misses the

FamilyLabsCS.RvtCmd_FamilyCreateColumnRectangle”

contained in FullClassName (PICTURE ERROR.JPG). Why is that? Thanks for your cooperation.

0 Likes
Accepted solutions (1)
1,521 Views
13 Replies
Replies (13)
Message 2 of 14

saikat
Autodesk
Autodesk

Can you please zip up the VS project containing all the code you have written so far (inlcuding the addin file) and I will take a further look.

 

Please do ensure you do not send any information that might be considered confidential.

cheers



Saikat Bhattacharya
Senior Manager - Technology Consulting
0 Likes
Message 3 of 14

Anonymous
Not applicable

Thanks for the reply ... I attach the file that contains the code in Visual C # and the addin file.

0 Likes
Message 4 of 14

saikat
Autodesk
Autodesk

The problem was with the entries in the .addin manifest file.

 

I have fixed the .addin file - removed the redundant accessibility tag and fixed the problem with the vendor description tag. And following this, the command was displayed successfully in the External Tools drop down list and did not show the error dialog you had attached.

 

The .addin file is attached with this post. Please change the path of the addin dll before using it.

 

There are some other problems with the code which you can now look into and fix - now that the command is accessible.

 

cheers



Saikat Bhattacharya
Senior Manager - Technology Consulting
0 Likes
Message 5 of 14

Anonymous
Not applicable

The original file in VISUAL C # (downloaded from Autodesk,that for the addin file), shows errors: The name Util does not exist in the current context (debug lines 108-143-152-157). For this reason, I eliminated in the bar / / these lines (see zip file sent).
Now in revit architecture errors can occur (see img). Are due to the lines of the program Visual C #?
Thanks for your cooperation.

0 Likes
Message 6 of 14

saikat
Autodesk
Autodesk

I am not sure where you got the VS project from, but like you mentinoed, it was missing the Utils class. I have included that in your project and uncommented all the code that was accessing this class.

 

Now if you test the attached VS project with Metric Column.rft template file, it should create the rectangular column that you wish to create. I have also included the .addin file in the VS project. Please ensure you change the path of the dll in the .addin file to what you have on your system.

 

hope this helps.



Saikat Bhattacharya
Senior Manager - Technology Consulting
0 Likes
Message 7 of 14

Anonymous
Not applicable

Sorry again ....... but still gives me the same error (such as img) in row:

RIGA 113 : Extrusion pSolid = createSolid();

RIGA 189 : SketchPlane pSketchPlane = _doc.FamilyCreate.NewSketchPlane(pRefPlane.Plane);

Thanks for your cooperation.

0 Likes
Message 8 of 14

saikat
Autodesk
Autodesk

Please ensure you are using 'Metric Column.rft' for the VS sample you are using. As you can see in the attached screenshot, the VS project executes well with the Metric Column template file.

 

 

 



Saikat Bhattacharya
Senior Manager - Technology Consulting
0 Likes
Message 9 of 14

Anonymous
Not applicable

I'm sorry if I insist again .... I downloaded again from the exercise:

http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=2484975

(revitapi2013training.zip)

I created the addin file and compiled "Familivb" Then I loaded in Revit "Metric Column.rft" (I arrived all'img1 attached). So far it worked fine. Now if I create the column I click on: “FamilylabsCreateRectangularColumn"

(img1). Now he must create the column and instead I get an error (img.2 - img.3).

How can 'see revit stops on lines 114 and 191 .... then conclude that until this works.

Ah I wanted to say that I changed my language. Are in VB Express 2010.

Thanks for your cooperation ...... I'm sorry if I can not yet.

0 Likes
Message 10 of 14

saikat
Autodesk
Autodesk

I tested the Labs from the link you have provided using VB 2010 Express and it works fline at my end.

 

The error that you are seeing at your end is with the template that you are using. The Bottom Reference Plane that is being used in the code is called "Reference Plane" and I am quite certain it is named differently in the template you are using.

 

Using the Revit LookUp, I can see that in the template (Metric Column), I have a reference plane called "Reference Plane" which is what the code is expecting to see as well. I am inlcuding a screenshot which shows what the reference plane is named in my case. You can check the name of the reference plane in your template and change the code accrodingly to make it work (at line 191).

 

If you need further help, it might be a good idea to zip up the template you are using send it to me via message.

 

 



Saikat Bhattacharya
Senior Manager - Technology Consulting
0 Likes
Message 11 of 14

Anonymous
Not applicable

Excuse me, how did you see "Snopp Objects" in your picture ........ Also in other programs by an error reported to the model name of revit ........ Thanks for your cooperation

0 Likes
Message 12 of 14

Revitalizer
Advisor
Advisor

Hi al.volt,

 

you can find the snoop tool in the Revit SDK.

It's called "RevitLookup" and ships with its source code.

 

Cheers,

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes
Message 13 of 14

Anonymous
Not applicable
Accepted solution

Now it works fine ....... Thanks for the help .......
I changed all the names related to layers, views, etc.. file in visual basic: they were in English rather than Italian

Message 14 of 14

saikat
Autodesk
Autodesk

Great. Glad to know it is all resolved now.

 

Good luck!



Saikat Bhattacharya
Senior Manager - Technology Consulting
0 Likes