Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Forum,
I have adapted some code for locating a sketch symbol on the center of a view; however I need to move it off center in the y direction and nothing I do works, any ideas?
Sub Main() ' DeleteSymbols() PlaceClutchRotationSymbol("FRONT VIEW","Clutch Rotation (Input End)") ' PlaceDriveSymbol("TOP VIEW","INPUT END (DRIVE)") ' PlaceDrivenSymbol("TOP VIEW"," OUTPUT END (DRIVEN)") End Sub ' Add symbols to show grain direction on a view Sub PlaceClutchRotationSymbol(viewName As String, symbolName As String) Dim drawDoc As DrawingDocument drawDoc = ThisApplication.ActiveDocument Dim sheet As Sheet sheet = drawDoc.ActiveSheet Dim symbolDef As SketchedSymbolDefinition symbolDef = drawDoc.SketchedSymbolDefinitions.Item(symbolName) ' Select a drawing view. Dim drawingView As DrawingView drawingView = ActiveSheet.View(viewName).View ' Get center of the view to place the symbol Dim symbolCenter As Point2d = drawingView.Center ' If it is the Front view, move the center of the symbol so it displays centered on the face of the part If viewName = "Front View" Then symbolCenter.X = symbolCenter.X - ActiveSheet.View(viewName).Scale * .75 symbolCenter.Y = symbolCenter.Y - ActiveSheet.View(viewName).Scale * .4 End If ' Default scale is 1 Dim symbolScale As Double = 1 Dim sketchedSymbol As SketchedSymbol sketchedSymbol = sheet.SketchedSymbols.Add(symbolDef, symbolCenter, symbolRotation, symbolScale) sketchedSymbol.Static = True End Sub
I need this;
I get this;
Solved! Go to Solution.