Hi bhprest and thanks for your anwser! All you tell me seems logic but I still have the same problem. I tried all that but still some errors are raising. I confirm that I am using an application module. According to the Autodesk help website, the "Application" keyword should work for me but as long as I type "Application" this error raise:
UIDocument uidoc = this.ActiveUIDocument;
Autodesk.Revit.DB.Document doc = uidoc.Document;
// UIApplication uiapp = new UIApplication(Application);
CategorySet CatSet = Application.NewCategorySet();
- 'Autodesk.Revit.ApplicationServices.Application' doesnt have a definition of 'NewCategorySet'
Its clearly pointing to another Application object. And the thing is, no other approach seems to work for me. I have tried also:
UIDocument uidoc = this.ActiveUIDocument;
Autodesk.Revit.DB.Document doc = uidoc.Document;
UIApplication uiapp = new UIApplication(Application);
CategorySet CatSet = uiapp.NewCategorySet();
And the error is:
- 'Autodesk.Revit.UI.UIApplication' doesnt have a definition of 'NewCategorySet'.
Then I also tried:
UIDocument uidoc = this.ActiveUIDocument;
Autodesk.Revit.DB.Document doc = uidoc.Document;
UIApplication uiapp = new UIApplication(Application);
CategorySet CatSet = uiapp.Application.NewCategorySet();
And in this case the error is:
- 'Autodesk.Revit.ApplicationServices.Application' doesnt have a definition of 'NewCategorySet'.
Then I also tried:
UIDocument uidoc = this.ActiveUIDocument;
Autodesk.Revit.DB.Document doc = uidoc.Document;
//UIApplication uiapp = new UIApplication(Application);
CategorySet CatSet = this.Application.NewCategorySet();
And in this case the error is:
- 'Autodesk.Revit.ApplicationServices.Application' doesnt have a definition of 'NewCategorySet'.
Its a bit confused but I think I have tried every single posibility according to my knowledge here. I think Im missing something but I dont know what is. I believe that the first way is the one that should work according to what I see in the help site.
Thanks you so much for your anwser. Regards