Export "DWG" select a face using a VBA macro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can anybody help????
I have the following code that outputs an AutoCAD "Dwg" file of an extruded face. The output is a 2d profile.
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oBaseFace As Face
Set oBaseFace = oDoc.SelectSet.Item(1): THIS IS THE PROBLEM LINE!!!!
Dim Cm As CommandManager
Set Cm = ThisApplication.CommandManager
Call Cm.PostPrivateEvent(PrivateEventTypeEnum.kFileNameEvent,"C:\Test.dwg")
Dim oCtrlDef As ButtonDefinition
Set oCtrlDef = ThisApplication.CommandManager.ControlDefinitions.Item("GeomToDXFCommand")
Call oCtrlDef.Execute
It works fine but I have to pre-select the face of the extrusion manually before running the macro. Does anybody know how to automatically select the face using the VBA macro rather than manually selecting the face first?
All I am doing is creating a sketch (Lines/Arcs/Circles) then extruding the sketch. Nothing else!
Many thanks in advance!!!!
Darren