TheSwamp
Code Red => .NET => Topic started by: Keith Brown on June 18, 2015, 09:42:30 AM
-
I am working with automatically generating viewports on a sheet based on drawing views and I am calculating the viewport scale. Currently I have one scale hard coded (1/4" = 1') into the program along with its viewport scale factor of 48. My question is that given the AutoCAD .NET API enumeration of StandardScaleType.Scale1To4inchAnd1ft is there anything in the API to return 48? Do I need to calculate the viewport scale factor for each enumeration? It is not hard to do and I have all the values already calculated and written down but before I write the class to generate this I thought that there might already be something in the API.
Thanks.
-
CustomScale property if I remember correctly.
-
Yes, that is it. Thank you.
-
I had issues implementing the API version of this. I believe it had to do with setting the standard scale, the height, and the width of the viewport and the order in which you set them. To make it easy on myself i just went ahead and created a quick method to return the scale factor that I was expecting.
I probably would not have had to do this if there was halfway decent documentation on the API.
-
I probably would not have had to do this if there was halfway decent documentation on the API.
It's a pity someone from AutoDesk who could do something about this didn't visit these forums.
#IsThereAnybodyOutThereWhoCares
-
afterthought added:
They're too busy playing with stuff that is going to make the world a better place ... oh, wait ....
-
It's a pity someone from AutoDesk who could do something about this didn't visit these forums.
#IsThereAnybodyOutThereWhoCares
+1
-
For anyone else finding this thread and wondering what to do the Autocad .net help file does touch upon the subject.
The StandardScale and CustomScale properties are used to specify the scale for a viewport. The StandardScale property accepts a value based on the StandardScaleType enum; whereas the CustomScale property accepts a real number which represents the ratio of units between Model and Paper space. For example, the real value equal to 1:4 is 0.25.
You can read the whole article here. (http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-4A177301-1624-45F5-97E9-8832E484B0FB)