Message 1 of 9
How to get the definition out of an include workfeature in a drawing

Not applicable
02-25-2010
04:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
A drawing (idw) has a centermark, which is an icluded workfeature of a ThreePlanesWorkpoint type.
In the following example I want to get the name of the first plane of this workpoint.
Dim oCentermark As Centermark
Dim oWorkpoint As WorkPoint
Dim oWorkpointDef As ThreePlanesWorkPointDef
Dim oPlane1 As WorkPlane
'' The active document is an idw
'' Assuming the first selected item is a ThreePlanesWorkpoint
Set oCentermark = ThisApplication.ActiveDocument.SelectSet(1)
Set oWorkpoint = oCentermark.AttachedEntity
Set oWorkpointDef = oWorkpoint.Definition
Set oPlane1 = oWorkpointDef.Plane1
MsgBox (oWorkpoint.Name)
MsgBox (oPlane1.Name)
The program stops at the line Set oWorkpointDef = oWorkpoint.Definition with the error message;
Run-time error'445':Object doesn't support this action
Does anyone know another way of getting to the name of the first plane? Edited by: PeterKingma on Feb 25, 2010 12:08 PM
A drawing (idw) has a centermark, which is an icluded workfeature of a ThreePlanesWorkpoint type.
In the following example I want to get the name of the first plane of this workpoint.
Dim oCentermark As Centermark
Dim oWorkpoint As WorkPoint
Dim oWorkpointDef As ThreePlanesWorkPointDef
Dim oPlane1 As WorkPlane
'' The active document is an idw
'' Assuming the first selected item is a ThreePlanesWorkpoint
Set oCentermark = ThisApplication.ActiveDocument.SelectSet(1)
Set oWorkpoint = oCentermark.AttachedEntity
Set oWorkpointDef = oWorkpoint.Definition
Set oPlane1 = oWorkpointDef.Plane1
MsgBox (oWorkpoint.Name)
MsgBox (oPlane1.Name)
The program stops at the line Set oWorkpointDef = oWorkpoint.Definition with the error message;
Run-time error'445':Object doesn't support this action
Does anyone know another way of getting to the name of the first plane? Edited by: PeterKingma on Feb 25, 2010 12:08 PM