Help to translate simple VBA code to Python

  • Thread starter Alexandr N Zamaraev
  • Start date
A

Alexandr N Zamaraev

I use Bentley MicroStation through Automation interface.
But I do not known how translate some VBA code to Python.
For example ("Copy Element Example" from documentation):

<code>
'The following code starts the command
Sub RunCopyElement()
CommandState.StartLocate New clsCopyElementCommand
End Sub

'This following code must be in a class that implements
ILocateCommandEvents. In this example, it is in the class
clsCopyElementCommand.

Implements ILocateCommandEvents

' This is called when the user enters a data point after the
' LocateFilter has accepted an element
Private Sub ILocateCommandEvents_Accept(ByVal Element As Element, Point
As Point3d, ByVal View As View)
'skip function body
End Sub

Private Sub ILocateCommandEvents_Cleanup()
End Sub

Private Sub ILocateCommandEvents_Dynamics(Point As Point3d, ByVal View
As View, ByVal DrawMode As MsdDrawingMode)
'skip function body
End Sub

Private Sub ILocateCommandEvents_LocateFailed()
'skip function body
End Sub


Private Sub ILocateCommandEvents_LocateFilter(ByVal Element As Element,
Point As Point3d, Accepted As Boolean)
'skip function body
End Sub

Private Sub ILocateCommandEvents_LocateReset()
'skip function body
End Sub

Private Sub ILocateCommandEvents_Start()
'skip function body
End Sub
</code>
Also sample using interface ILocateCommandEvents:
http://www.la-solutions.co.uk/content/MVBA/MVBA-MeasureArea.htm

All interface derived from IDiapach.

How to realize in Python without external DLL?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top