Message 1 of 2
Place a origin wp in the sketch (ipt)

Not applicable
06-15-2007
08:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have this code to place a wp at the origin while in the sketch mode
It works fine with IV11 and seems to be not working with IV2008
Thx, CVA
On Error Resume Next
Dim oDoc As Document
Set oDoc = oInventorApp.ActiveDocument
If oInventorApp.ActiveDocument.DocumentType <> kPartDocumentObject And _
oInventorApp.ActiveDocument.DocumentType <> kAssemblyDocumentObject
Then
MsgBox ("Please use this button in Assembly or Part Sketch only")
Exit Sub
End If
Dim oSketch As PlanarSketch
If oDoc.SketchActive Then
'get active sketch
Set oSketch = oDoc.ActivatedObject
'project part origin
Dim oPoint As SketchEntity
Dim oWorkPoint As WorkPoint
Set oWorkPoint = oDoc.ComponentDefinition.WorkPoints.Item(1)
Set oPoint = oSketch.AddByProjectingEntity(oWorkPoint)
Else
MsgBox ("A sketck must be active")
End If
--
www.CVAengineering.com
IV11 Pro. sp2 and IV2008
Window XP Pro sp2
Pentium 3.2 Ghz, 3.0 GB of RAM
NVIDIA FX 3400 84.26
SpacePilot V 1.1.2
It works fine with IV11 and seems to be not working with IV2008
Thx, CVA
On Error Resume Next
Dim oDoc As Document
Set oDoc = oInventorApp.ActiveDocument
If oInventorApp.ActiveDocument.DocumentType <> kPartDocumentObject And _
oInventorApp.ActiveDocument.DocumentType <> kAssemblyDocumentObject
Then
MsgBox ("Please use this button in Assembly or Part Sketch only")
Exit Sub
End If
Dim oSketch As PlanarSketch
If oDoc.SketchActive Then
'get active sketch
Set oSketch = oDoc.ActivatedObject
'project part origin
Dim oPoint As SketchEntity
Dim oWorkPoint As WorkPoint
Set oWorkPoint = oDoc.ComponentDefinition.WorkPoints.Item(1)
Set oPoint = oSketch.AddByProjectingEntity(oWorkPoint)
Else
MsgBox ("A sketck must be active")
End If
--
www.CVAengineering.com
IV11 Pro. sp2 and IV2008
Window XP Pro sp2
Pentium 3.2 Ghz, 3.0 GB of RAM
NVIDIA FX 3400 84.26
SpacePilot V 1.1.2