Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VBA Creating path from derived sketch block

1 REPLY 1
Reply
Message 1 of 2
Anonymous
651 Views, 1 Reply

VBA Creating path from derived sketch block

Hi everyone.

 

I've got a problem with creating Path in Inventor VBA. I've created a source block definition in SourcePart.ipt, derived it in DestPart.ipt, placed this derived SketchBlockDefinition in Sketch3 and draw 3 extra lines. Now i want to add a SplitFeature with SplitTool as a Path of 3 lines, but first i need to create this Path. There is no problem with creating path from this 3 extra lines, but when i want to create path from lines that belongs to derived block - an error occurs. 

 

Below is sample code (also included in attached file - DestPart.ipt). Try run it with DestPart.ipt as an active file. When Inventor is prompting for Selecting Sketch Entity first select one of 3 extra lines, macro ends with no errors. Then run it again, this time select one of 3 lines that belongs to SketchBlock - an error occurs.

 

When you try to add SplitFeature (Trim Solid) by UserInterface Button "Split" there is no problem with any set of 3 lines.

 

Sub CreatePathTest()

    Dim oPartDoc As Inventor.PartDocument
    Set oPartDoc = ThisApplication.ActiveDocument

    Dim oPickedSketchEntity As Inventor.SketchEntity
    Set oPickedSketchEntity = ThisApplication.CommandManager.Pick(kSketchCurveFilter, "Select Sketch Entity")
    
    Dim oNewPath As Inventor.Path
    Set oNewPath = oPartDoc.ComponentDefinition.Features.CreatePath(oPickedSketchEntity)

End Sub

My System is Windows 7 32bit/64bit, Inventor 2012 

 

Thanks in advance for any help.

 

1 REPLY 1
Message 2 of 2
xiaodong_liang
in reply to: Anonymous

Hi,

 

This is an issue which has been logged:

SkBlock, Path: CreatePath and CreateSpecifiedPath doesn't work for sketch block curve.

 

And it exists in 2014 as well. Sorry if this is a bas news for you.

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report