I'm using the Bentley.CifNET.GeometryModel.SDK.Edit.TemplateDropEdit object to change a template drop station range.
The function I use is
editTD.SetDistanceDefinition(metricDist, metricEndDist) with the input being the distance to the stop and start stations in metric.
graphically it does what I want. However there are some other odd things that happen.
If I hover over the c# updated template drop in the 2d view the tool tip gives me the right station range.
If I click on the c# updated template drop to edit the station range it does not show the stations but gives me the distances instead. The distance also has the foot symbol suffix added to it. If I go to the bucket command to edit the corridor it also shows the distances (with the foot symbol suffix) for the c# updated template drop instead of the stations.
My program has a dialog box that shows the all the template drop station ranges for a corridor. After editing a template drop using the above command and then showing by dialog box again, the edited template drop will display the start and ending station for the corridor alignment. Thus the template drop functions StartDistance and EndDistance return 0 and the length of the alignment for the c# updated template drop.
There are some other template edit functions functions
Which can be set to
You can only change it the end distance, start distance is read only. Changing the end one did not make a difference.
Has anyone had success with the
If you save the dgn after using the SetDistanceDefinition method, is it still showing the distances instead of the stations?
Also, can you confirm the exact ORD version number?
The version I'm using is 10.10.01.03.
If I save the file it still shows the distances and getting the start/end distance via c# still gives me back 0 and the alignment length. However, if I close and reopen the file, the file, the template drop station limits text fields still show distances but when I get the start/end distance via c#, it does give me the correct distances.
Looks like "SetDistanceDefinition" function somehow causes the functions "StartDistance" and "End distance" to return values that use the setting "EntireElement" for the "DistanceDefinitionMethod" assuming the element is the alignment while in the same drawing session. And then saving and re-opening the file then calculate the distances correctly.
For the template drop it seems like there is an internal setting for the station limit display; either stations or distances. This setting is not exposed to the end user. And so far I can't see this setting exposed via c#.
Henrique, I did some more testing. I noticed the TemplateDropEdit object have the ready only functions
I looked at what those values were before and after using the SetDistanceFunction. The StartStation and StopStation functions gave the right values so I updated my program to use those functions and my program works as expected. The StartDistance and EndDistance functions for both the TemplateDrop and TemplateDropEdit return 0 and alignment length after using the SetDistanceFunction but will return the correct values when I save and re-open the dgn file.
Now I just need to figure out how to get the template drop to show stations and not distances after using the SetDistanceFunction?
The StartDistanceDefinitionMethod is read only. The EndDistanceDefinitonMethod indicates you and update it. I tried it by changing the values for all the template drops and it does update them. but as soon as I use the SetDistanceDefiniton function to change the limits it changes the method back to "GivenDistance".
Thank you for the additional information.
I am now able to reproduce it and I am currently investigating the causes.
A bug has been filed and is in our queue to be fixed.