I have got another one for the experts ... :-)
Here's my situation:
The screenshot shows view1 and view2 - both show the same elements (a number of SmartSolid-Elements). View1 is a front view while view2 is top view.
I am looking for a way to zoom view2 so that the element appears in the same size ratio:
How can this be achieved?
Hi,
I guess it would be (depending on specific conditions) not very complicated: Take an element (even a virtual), using both views parameters calculate how such element is displayed in the views (depending on rotation the size is different) and set parameters of the second view accordingly to this calculation.
Some (pre)conditions exist
I am not sure if VBA is enough, but as usually C/C++ APIs are much better to work with view parameters.
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi Jan,
thanks for your response & your time!
I could create a LineElement (from the beginning of first element on the left side to the end of the last element on the right side) like this:
The length of this line is 3161.
When I now measure the gaps on each side I get the following:
View1:
View2:
The gap on each side in View1 is approx. 1637 while in View2 it is approx. 63
How can I calculate the gaps? I thought that Line.Startpoint.X - View1.Origin.X should be the gap but it isn't ...
I think I am a real dummy ...
in my opinion what you describe it's not the right approach, but please be aware it's based on off-hand thinking only.
My idea how to implement the discussed functionality is:
It gives you a coefficient how elements are shortened because of a view rotation.
The ratio between view size in units and pixels gives you another coefficient.
Using these numbers you have to create a formula, which will tells you how many pixels long is this virtual element,
For the second view you need similar formula, where the only variable is the view size in units. If you put both formulas equal (which is what happen if an element is displayed in the same size), the result will be size in units for the second view.
With regards,
Answer Verified By: quasi_modo