Message 1 of 9
iLogic in IPT file to Insert Sketch Blocks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Ok basically I have an IPT file with a few different 2d sketch blocks I also have a 2d Sketch called "Profile" basically what you would do is edit the "Profile" sketch and Place Block selecting what ever profile you needed to extrude (Square Tube, Angle, Plate,Pin, Round Tube) Im looking for a way to do this with ilogic so far Ive been able to activate the "Profile" Sketch and delete the current block thats placed in the sketch but when I try to insert a new block the code errors out. see code below
Dim oPartDoc As PartDocument oPartDoc = ThisApplication.ActiveDocument Dim oCompDef As PartComponentDefinition oCompDef = oPartDoc.ComponentDefinition Dim oSketches As PlanarSketches oSketches = ThisApplication.ActiveDocument.ComponentDefinition.Sketches Dim oSketch As PlanarSketch oSketch = oSketches.Item("Profile") oSketch.Edit oSketch.sketchblocks.item(1).delete Dim oSketchBlockDef As SketchBlockDefinitions oSketchBlockDef = oCompDef.SketchBlockDefinitions.Item("Plate")
This is where it errors out stating "The Parameter is incorrect" (See attached picture for a screenshot of the "More Info section of the Error Message) Dim oPosition As Point2d oPosition = ThisApplication.TransientGeometry.CreatePoint2d(0, 0) ' Insert the sketch block definition oSketch.SketchBlocks.AddByDefinition(oSketchBlockDef, oPosition) oSketch.exitedit
Computer Specs:
Windows 7 (64 Bit) Pro. SP1, Inventor 2014 Pro, 3D Connexion SpaceNavigator (Driver 3.15.2)
Motherboard: ASUS Rampage IV Extreme x79 Socket 2011
Processor: Intel Core i7 Six Core Sandy Bridge-E 3.2GHz OCed to 4.7GHz (Under Water)
RAM: G.Skill Ripjaw Z-Series 32 gig quad channel of RAM 1800MHz OCed to 2133MHz
Video Card: 2x Nvidia Geforce GTX 770 (Running Six (6) Monitors)
Monitors: [Primary = 2x 24in HD WS][Secondary = 2x 22in HD WS][Tertiary = 2x 19in FS]
Primary Hard Drive: OCZ Vertex IV 256 GB Solid State Drive
Secondary Hard Drive: OCZ Vertex III 120 GB Solid State Drive
Windows 7 (64 Bit) Pro. SP1, Inventor 2014 Pro, 3D Connexion SpaceNavigator (Driver 3.15.2)
Motherboard: ASUS Rampage IV Extreme x79 Socket 2011
Processor: Intel Core i7 Six Core Sandy Bridge-E 3.2GHz OCed to 4.7GHz (Under Water)
RAM: G.Skill Ripjaw Z-Series 32 gig quad channel of RAM 1800MHz OCed to 2133MHz
Video Card: 2x Nvidia Geforce GTX 770 (Running Six (6) Monitors)
Monitors: [Primary = 2x 24in HD WS][Secondary = 2x 22in HD WS][Tertiary = 2x 19in FS]
Primary Hard Drive: OCZ Vertex IV 256 GB Solid State Drive
Secondary Hard Drive: OCZ Vertex III 120 GB Solid State Drive