DividedSurface - specific Tile Pattern

DividedSurface - specific Tile Pattern

RECArchi
Collaborator Collaborator
416 Views
8 Replies
Message 1 of 9

DividedSurface - specific Tile Pattern

RECArchi
Collaborator
Collaborator

Hi,

My plugin creates an instance of a Mass Family in my project. This family contains a "NewFormByCap", which has a DividedSurface.

I managed to load a Pattern component family (nested family, created by myself, stored in our server).

Is-it possible to apply this specific pattern to the DividedSurface?

As far as I read, it can be done using "ChangeTypeId" on  the DividedSurface*, buit it's only available for builtin tile patterns.

* see : https://knowledge.autodesk.com/fr/support/revit/learn-explore/caas/CloudHelp/cloudhelp/2014/FRA/Revi...

 

Does anyone have a solution?

 

Thank you in advance.

 

0 Likes
417 Views
8 Replies
Replies (8)
Message 2 of 9

RPTHOMAS108
Mentor
Mentor

Not tried setting it with API however from your link above:

 

"In addition to applying built-in tile patterns to a divided surface, you can create your own massing panel families using the "Curtain Panel Pattern Based.rft" template. These panel families can then be loaded into massing families and applied to divided surfaces using the DividedSurface.ChangeTypeId() method."

 

I was using this one:

Metric Generic Model Pattern Based.rft

However sounds like you can also use this one:
Metric Curtain Panel Pattern Based.rft

 

The fun of family templates: not being able to convert one to another and finding out halfway through the day you are using the wrong one.

 

You need a pattern based family that is compatible with one of the built-in patterns e.g. below I have a 4 point adaptive component and that is compatible with 'Triangle (bent)' amongst others.

 

Are you having problems setting it via DividedSurface.ChangeTypeId (in the massing family), that would be my first go at it. If that doesn't work try setting it to the equivalent built-in pattern first perhaps (although it should not be required). I think you can set in the project if you have a parameter for that in the massing family.

 

211110b.png

 

211109a.png211109.PNG

 

Failure could also be due to the surface divisions leading to bad component geometrical configuration (it would usually handle that in failures processing by asking to delete the bad adaptive component instances). So see what works in terms of divisions, spacing etc. in the UI and then use that in API.

 

0 Likes
Message 3 of 9

RECArchi
Collaborator
Collaborator

Hi @RPTHOMAS108 ,

 

Thank you for your reply !

"The fun of family templates: not being able to convert one to another and finding out halfway through the day you are using the wrong one." --> 😓

I am using nested "Metric Curtain Panel Pattern" Based family, compatible for what I need. I tried to model it directly in Revit --> it works perfectly.

"I think you can set in the project if you have a parameter for that in the massing family." --> WAHOU. Awesome. 😀 I I was aware of liniking "Family Type" for nested families, but I never saw "Divided Surface Type" (nor "Repeated Component Type" !!!). It will be MUCH more efficient managing this patten in the project, indeed. I checked, it works in Revit, I will try to code it in API (I never created parameters / link parameters of nested families through API... I hope it's not too complicated), and let you know the result. 

Thank you again, your idea is really cool. 😁

Sincerely.

0 Likes
Message 4 of 9

RECArchi
Collaborator
Collaborator

Hi @RPTHOMAS108 ,

I manage to create family parameters and link them using FacilityManager (AddParameter and AssociateElementParameterToFamilyParameter)

However, I do not manage to create a family parameter of type "DividedSurface", I have an "Illegal category" message when I try to create the parameter. How can you create such a parameter ?

And how do you link it to the nested family type ?

Thank you in advance.

0 Likes
Message 5 of 9

RPTHOMAS108
Mentor
Mentor

I thought that may be the case.

 

Are you using: ExternalDefinitionCreationOptions(String, ForgeTypeId)?

 

As was the previous case with parameters of FamilyType you could generate the shared parameter file via IO.StreamWriter and then use those parameters instead of creating definitions via API.

 

# This is a Revit shared parameter file.
# Do not edit manually.
*META	VERSION	MINVERSION
META	2	1
*GROUP	ID	NAME
GROUP	1	Main
*PARAM	GUID	NAME	DATATYPE	DATACATEGORY	GROUP	VISIBLE	DESCRIPTION	USERMODIFIABLE	HIDEWHENNOVALUE
PARAM	8a79948f-a200-4884-9623-d31c040f00b5	DivSurfTypeParam	DIVIDEDSURFACETYPE	-2000170	1	1		1	0
PARAM	25c621f6-3cfa-40d2-b849-3d14294b7352	RepComponentParam	COMPONENTREPEATERTYPE	-2000151	1	1		1	0

 

 

 

0 Likes
Message 6 of 9

RECArchi
Collaborator
Collaborator

OK I managed to add a shared parameter of Type "DividedSurface" 😀

Now, how do you "bind" the nested family Type to this family parameter through the API ? (see attached image)

Thank you !

0 Likes
Message 7 of 9

RECArchi
Collaborator
Collaborator

@RPTHOMAS108 : I tried to retrieve "dividedsurface.get_Parameter(BuiltInParameter.ELEM_FAMILY_PARAM)" and use it as input for AssociateElementParameterToFamilyParameter, but Revit says : "This parameter cannot be associated".

How can I achieve this ?

0 Likes
Message 8 of 9

RPTHOMAS108
Mentor
Mentor

You could also try:

ELEM_TYPE_PARAM -1002050

then

ELEM_FAMILY_AND_TYPE_PARAM -1002052

in that order.

 

However if those fail it may be something that can only be done in the UI.

0 Likes
Message 9 of 9

RECArchi
Collaborator
Collaborator

Hi @RPTHOMAS108 ,

I tried these 2 parameters, no one works.

0 Likes