I have a sketchblock in a sketch that I need to postion into the correct quadrant. I have dimensions on the sketchblock that are told to be driven while running the quadrant position task shown below. see image. Sketchblock is currently in quadrant 1 and I need to be able to push that into the 3rd, thus the (-200,-200).
After it is in the correct quadrant I power the dimensions to constraint the sketchblock into correct position.
The question is, how do I position the sketchblock in the correct quadrant via 'position'?
This method works in your case:
Sub MoveBlock() Dim oDoc As PartDocument Set oDoc = ThisApplication.ActiveDocument Dim oDef As PartComponentDefinition Set oDef = oDoc.ComponentDefinition Dim oSketch As Sketch Set oSketch = oDef.Sketches.Item(1) Dim oBlock As SketchBlock Set oBlock = oSketch.SketchBlocks.Item(1) Dim oP As Point2d Set oP = oBlock.Position oP.x = oP.x + 1 oP.y = oP.y + 1 oBlock.Position = oP oSketch.Solve End Sub
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register