Parametric angle, radius and number properties of radial array using API

Parametric angle, radius and number properties of radial array using API

Anonymous
Not applicable
1,226 Views
3 Replies
Message 1 of 4

Parametric angle, radius and number properties of radial array using API

Anonymous
Not applicable

Hi guys,

 

I'm developing an plugin for Revit which generates a family file. This family contains an extrusion geometry and a radial array of that geometry. The idea behind this is that the user can open the RFA and through the parameter window can manipulate the angle, number of columns and the radius of the radial array. 

 

So I followed the Alfredo Medina's example:

http://planta1.com/blog/controlling-the-3-properties-of-a-radial-array-angle-number-of-items-and-rad...

 

I would like to do it programmatically, because the geometry, that have to be repeated, could change depending on some customer requirements. For instance, it could be an extrusion (boxes, cilinder), revolve, family instance...

This way the user can create catalog types of that family.

 

Is it possible to constraint programmatically the angle and radius of the array as Alfredo did manually?

 

Thanks in advance

0 Likes
1,227 Views
3 Replies
Replies (3)
Message 2 of 4

jeremytammik
Autodesk
Autodesk

Thank you for a very cool question.

 

Yes, we can!

 

Look at the arguments that you pass in to the RadialArray.Create method:

 

http://www.revitapidocs.com/2018/7c01712e-10c5-ac45-d6bd-4bdb44860723.htm

 

It covers all your requirements.

 

For the rest, check out how to research to address a Revit API programming task:

 

http://thebuildingcoder.typepad.com/blog/2017/01/virtues-of-reproduction-research-mep-settings-ontol...

 

Good luck!

 

Cheers,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 4

Anonymous
Not applicable

Thanks Jeremy for the quick reply,

 

actually I know how to create Radial Arrays, the problem is how to make parametric the radial array "properties": angle, radius, number. It means, that my plugin will generate a RFA that allows the user to change the angle, radius, and number of copies using the Family types dialog.

 

I have seen that for constraining the number of copies, I have to do something like:

 

Extrusion extrusion = CreateBox(doc);
Autodesk.Revit.DB.View pView = findElement(typeof(ViewPlan), "Ref. Level", doc) as Autodesk.Revit.DB.View; var offset = new XYZ(UnitUtils.ConvertToInternalUnits(-5, DisplayUnitType.DUT_MILLIMETERS), 0, 0); RadialArray radialArray = RadialArray.Create(doc, pView, extrusion.Id, 6, Line.CreateBound(offset, XYZ.BasisZ + offset), 60*Math.PI/180, ArrayAnchorMember.Second); doc.Regenerate();
//parametric number of copies FamilyParameter familyParam = doc.FamilyManager.AddParameter("ArrayElements", BuiltInParameterGroup.PG_CONSTRAINTS, ParameterType.Integer, true); radialArray.Label = familyParam;

 

but, how to constraint using the REVIT API the angle and radius of the Radialarray element?

 

Thanks in advance

0 Likes
Message 4 of 4

Anonymous
Not applicable

Hi Jeremy, 

 

I created a RFA file, to show you what I want to achieve. The idea is that after the user selects a geometry (cube, cylinder, etc), the plugin should generate programmatically a RFA file similar to the file that I have attached. If you open it, you can see that you can modify the 3 parameters of the radial array = number of geometries, radius and angle, just using the parameters dialog.

 

The customer wants this kind of RFA file to create later a family type catalog of that file and control 3 parameters automatically.

 

I still don't know if it is possible to create programatically a RFA file which parameterizes the angle of the radial array. Anyone has any idea how to achieve that?

 

I'm looking forward to hearing from you, thanks for your help in advance.

0 Likes