Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'd like to create a new custom element with custom geometry in Reivt that belongs to a custom sub category.
What I have done so far is:
- I have created a new Subcategory using NewSubcategory Method (revitapidocs.com)
Categories categories = doc.Settings.Categories;
Category siteCategory = categories.get_Item(BuiltInCategory.OST_Site);
Category customCategory = categories.NewSubcategory(siteCategory, "MY COORDINATES");
doc.Regenerate();
2. I have tried creating a new DetailCurve using NewDetailCurve Method (revitapidocs.com)
double radius = 10.0;
// Create the circle
Curve circle = Arc.Create(new XYZ(10, 10, 0), 10.0, 0.0, 2.0 * Math.PI, XYZ.BasisX, XYZ.BasisY);
// Create a new detail detailCurve element
DetailCurve detailCurve = doc.Create.NewDetailCurve(doc.ActiveView, circle) as DetailCurve;
However I can't figure out how to assign my new `DetailCurve` to my `customCategory` created earlier. Is there a way to do this?
My final goal is to be able to create a custom object that its visibility is dependent on my custom category so the user can toggle this from Visibility/Graphics Overrides settings. Is there a better way to do this?
Solved! Go to Solution.
Developer Advocacy and Support,