Hello everyone I write from Italy I would like to create a form through Mvba with a list of auxiliary coordinates present within a model, but this time I don't know exactly how to recover information relating to the name of the various "SCA" systems present.
Someone helps me ...
Thanks Tiziano
Hi Tiziano,
Tiziano Sapora said:but this time I don't know exactly how to recover information relating to the name of the various "SCA" systems present.
I agree with Barry it is not clear what do you mean by "SCA".
When I guess it's typing error and you mean, "ACS": Did you try to search MicroStation VBA documentation? Is is simple to find several code snippets and also objects related to ACS (Auxiliary Coordinate System).
I recommend to start with ScanForACSElements() method.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Found I was looking for a wrong topic thank you
Sub ListACSElements() Dim ee As ElementEnumerator Dim ele As AuxiliaryCoordinateSystemElement Set ee = ACSManager.ScanForACSElements Do While ee.MoveNext Set ele = ee.Current Debug.Print "Name " & ele.Name Debug.Print "Descr " & ele.Description Loop End Sub
That's quite straight forward, what do you intend to do with the listed ACS afterwards, or is it not something you need assistance with?
Private Sub CommandButton1_Click() Dim ee As ElementEnumerator Dim ele As AuxiliaryCoordinateSystemElement Set ee = ACSManager.ScanForACSElements Do While ee.MoveNext Set ele = ee.Current Debug.Print "Name " & ele.Name Debug.Print "Descr " & ele.Description ListBox1.AddItem ele.Name Loop End Sub
Fixed see code .... I learn something new every day.
Private Sub ListBox1_Click() Dim nome As String nome = ListBox1.Value Set ee = ACSManager.ScanForACSElements ACSManager.AttachNamed (nome), True, True End Sub
Tiziano,
Try the attached Macro, it lists all the ACS in the Design File. You can then select one of them from the ListBox, and activate it.
ListACS.mvba