If you don’t know how to record new Macro then check Macro Toolbar in DraftSight tutorial & record new VBA Macro for this tutorial.
If you already have recorded VBA Macro in DraftSight then use that file here.
Open any Software which consist of VBA Macro embedded such as Word, Excel,.. etc these will work as VBA Editor for DraftSight VBA Macro also you can run your macro from this.
A. Open Macro file:
- Lets say we open Microsoft Word document.
- Go to View Menu > Macros > View Macros.
- Now Give your macro name as ‘coLine’ for Create line macro, then Click on ‘Create’ tab
- Now that you have empty Macro Go to File > Import file. (Or you can copy paste macro program .)
- Change file of type to All files and Locate saved Macro (.swb) file and open.
- A new Module is added under ‘Modules’ on left corner project , double click on it to see our recorded macro !
B. Add reference to DraftSight:
- Now add a reference to the DraftSight type library, Go to Tools Menu > Click on ‘References ‘ Browse dsautomation.dll file from Install dir “C:\Program Files\Dassault Systemes\DraftSight\bin” \ dsAutomation.dll.
C. Run Macro:
- After adding Reference as above Start DraftSight and open a document..
- Now click on Run tab in Word macro file.
Line will be created in DraftSight from this recorded Macro.
Next Understand DraftSight VBA Macro code >>
🙂
Leave a Reply