[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Help to translate simple VBA code to Python

Alexandr N Zamaraev

2/11/2008 6:16:00 AM

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-Measu...

All interface derived from IDiapach.

How to realize in Python without external DLL?