Creating custom MullionType with RevitAPI

Creating custom MullionType with RevitAPI

Anonymous
Not applicable
946 Views
4 Replies
Message 1 of 5

Creating custom MullionType with RevitAPI

Anonymous
Not applicable

I  am working on some ways to automate the creation of curtain wall types in a project.

 

To do this I would like to first automate the creation of custom MullionTypes by  iterating through the family types within a custom Profile family and creating generating a new MullionType for each. 

 

Example steps:

 

1. Import profile_family with 3 types:

  • intermediate_mullion
  • post_mullion
  • doorframe_mullion

2. Get list of symbols from profile_family

 

3. For each symbol, create a MullionType under the Rectangular Mullion familly

 

4. Create new WallType of kind Curtain or duplicate an existing. Rename. 

 

5. Set new walltype parameters, use the the previously created MullionTypes in setting the Border1,Border2, and Interior parameters. 

 

Im stuck though on how one would create a MullionType with the custom profiles. Using RevitLookup I cannot see where  the Profile can be set. Within the ParameterSet, the "Profile" parameter doesn't provide access.

 

Help!

 

image.png

 

 

 

 

0 Likes
Accepted solutions (2)
947 Views
4 Replies
Replies (4)
Message 2 of 5

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear Brian,

 

Thank you for your query and the illuminating RevitLookup screen snapshot.

 

Why do you say that the image shows that the Profile parameter does not provide access?

 

As far as I can tell from your screen snapshot, it is read-write, and its storage type is ElementId.

 

Therefore, all you need to do is determine the desired profile element id 'x' and use the built-in parameter definition 'bip' (obtain it from the Profile > Definition > Built-in parameter enumeration value) to set it like this:

 

 

  Element mullion = ...
  mullion.GetParameter(bip).Set(x);

 

I hope this helps.

 

Best regards,

 

Jeremy



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

Message 3 of 5

Anonymous
Not applicable
Accepted solution

Hi Jeremy! 

 

Many thanks for your response. So quick! Initially had some issues but just worked it out.

 

Thanks for your help! Was as you said; I am not sure why I was not initially getting a null for the value of the "Profile" parameter. Perhaps I was too tired to notice my earlier mistake, working today! Excited. 

 

image.png

 

 

 

 

 

0 Likes
Message 4 of 5

zefreestijl
Advocate
Advocate

 

**Edit**

I found the answer,  It's because I forgot to use Transaction Start & Commit...

Thanks for this thread anyway 😛

**

--

 

Hi, sorry for replying to an old post,

but I couldn't find any source in a similar topic except this one 😞

 

I have the same question when I tried to set the profile parameter

 

 

zefreestijl_0-1641291028739.png

 

I'm trying to use both ElementID or ValueString to change the profile,

but none of them works,

 

am I missing something?

or if the MullionType only works in a Family Editor Document?

 

 

Thanks in advance :]

0 Likes
Message 5 of 5

jeremy_tammik
Alumni
Alumni

Well, the StorageType is shown as ElementId in your screen snapshot, so that is definitely the data type you have to use.

 

Set different mullion types manually through the UI and observe the different effects.

 

Then, do the same using the API, and you should achieve the same effect.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes