Is it possible to get import scale value of a fill pattern using Revit API?

Is it possible to get import scale value of a fill pattern using Revit API?

Anonymous
Not applicable
1,592 Views
5 Replies
Message 1 of 6

Is it possible to get import scale value of a fill pattern using Revit API?

Anonymous
Not applicable

Hello everyone,

 

Is it possible to retrieve 'Import scale' value of a project fill pattern using Revit API? If so then how?

I am looking for ways to retrieve the scale value which i can use in generating the preview image of a fill pattern in code.

 

Thanks in advance!

0 Likes
1,593 Views
5 Replies
Replies (5)
Message 2 of 6

jeremytammik
Autodesk
Autodesk

I cannot tell you offhand. I would have to create a minimal model and explore that, e.g., using RevitLookup.

 

I suggest you research it yourself as described here:

 

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

 



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

0 Likes
Message 3 of 6

Anonymous
Not applicable

Hi Jeremy,

 

Thanks for reply.

 

I checked RevitLookup (couldn't find any members representing scale value), and i checked Revit API documentation (to see if there are any parameterized methods for the same, and to search for it in general).

 

I was also searching forums in general and found your blog demonstrating preview generation for FillPatterns. In there you've hard coded scale (=50 for Model type, and 500 for drafting), however Scale value is not fixed and Revit UI allows user to modify it. 

 

So i thought to post it in forum to see someone has it figured-out or has direction to point me to for exploring further (like if it can be derived indirectly from computation of certain properties etc).

 

Looking forward to hear from you.

 

Best regards,

Shivani

 

0 Likes
Message 4 of 6

jeremytammik
Autodesk
Autodesk

How does the user modify the scale?

 

If the modification is saved in the Revit database, and it probably is, then it is almost certainly attached to some database element, and maybe accessible via an element parameter.

 

Maybe to the view?

  



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

0 Likes
Message 5 of 6

hugha
Collaborator
Collaborator

AFAIK import scale factor is not retained within the project following its import.   

 

A kludge could include a scale as text within the pattern name on import for later reference but this will not assist you with preexisting fills.

 

 

hth,

Hugh Adamson

www;hatchkit.com.au

 

 

 

 

 

 

 

 

 

0 Likes
Message 6 of 6

caroline.gitonga
Autodesk
Autodesk

I submitted this issue to the enginering team for consultation and maybe a workaround. Here is the resonse I got:

'I was able to learn the following. The recommended workflow through the UI is to duplicate and change the import scale. However, the scale is not directly exposed through the API. It is possible to get/set FillGrids and to get/set FillGrid's Segments. Therefore, it possible to reproduce the UI workflow through the API to some extent, by duplicating a pattern and then scaling its contents directly. There is some missing information. First of all, the import scale value. Second, it is necessary to adjust "window size" (a hidden property of the pattern) after setting the fill grids.'

Kindly, attempt above and see if you can come up with some sort of workaround.

Carol Gitonga, Developer Advocacy and Support, ADN Open
0 Likes