Create multiline text parametertype (sharedpatemater) via the api?

Create multiline text parametertype (sharedpatemater) via the api?

Anonymous
Not applicable
2,592 Views
7 Replies
Message 1 of 8

Create multiline text parametertype (sharedpatemater) via the api?

Anonymous
Not applicable

It appears to that that there is no multiline text parametertype in Autodesk.Revit.DB.ParameterType (revit 2016). Is this true?

0 Likes
Accepted solutions (1)
2,593 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
There isn't a multiline function in the GUI either. So I guess you can place a 'normal' text and use /r/n to go to the next line. (haven't tried this btw).
You can also make the textbox size smaller, so Revit will automatically place text to the next line.
0 Likes
Message 3 of 8

jeremytammik
Autodesk
Autodesk

Dear Nyo and Remy,

 

Thank you for your query and answer.

 

Yup, just like Remy says:

 

In general, if a feature is not available in the Revit product manually through the user interface, then the Revit API will not provide it either.

 

Therefore, before thinking about possibly automating any task, it is always important to explore the possibilities and develop an optimal solution through the user interface first.

 

I hope this helps.

 

Best regards,

 

Jeremy



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

0 Likes
Message 4 of 8

Anonymous
Not applicable

Hello,

Like Remy says, you can use a normal string and add a new line where needed.

 

This is possible to do manually too, by either pasting multiline text from some texteditor or using CTRL + ENTER to go to the next line.

 

 

Goodluck,

 

/martin

 

0 Likes
Message 5 of 8

Anonymous
Not applicable

Why can't it be done via the UI? Maybe we are not talking about the same thing..

Manage->Shared Parameters->Create a new parameter

.MultilineTextSharedParameter.PNG

0 Likes
Message 6 of 8

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear Nvo,

 

You are right.

 

I believe this omission in the API was an oversight and will be corrected in the next major release.

 

Sorry about that.

 

Cheers,

 

Jeremy



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

0 Likes
Message 7 of 8

Anonymous
Not applicable
Thank you. I'm looking forward to it
0 Likes
Message 8 of 8

Dale.Bartlett
Collaborator
Collaborator

Not sure that this fits the question, but as mentioned above, you can use New Line to add multiple lines to a text parameter:

string s = string.Empty;
    List<string> ll = LinkTools.GetListLinks();
    foreach (string l in ll)
    {
        // format list into string with returns
        s = s + "  \r\n" + Path.GetFileName(l);
    }
    // update family parameters
    lstrParameterName = "LinkedFileList";
    lstrParameterValue = s;
    lblnSuccessLinks = ParameterTools.PutProjectInfoParameters(doc, lstrParameterName, lstrParameterValue);

Dale

 




______________
Yes, I'm Satoshi.
0 Likes