Hey
When i add a sketch Symbol manually to my drawing over a drawing view, it stays attached to the drawing view if i move it. If i do the exact the same in code by placing the Sketch Symbol to the mouse pointer and placing it in the same position, it doesnt. When i place the Sketch Symbol at a predetermined point over the drawing view, it doesnt attach either. How can i get it to attach to the drawing view so that when the view is moved, thew Sketch Symbol also moves?
Code to attach
Dim doc As DrawingDocument
Set doc = ThisApplication.ActiveDocument
Dim modelPane As BrowserPane
Set modelPane = doc.BrowserPanes.Item("DlHierarchy")
Dim recources As BrowserNode
Set recources = modelPane.TopNode.BrowserNodes.Item("Drawing Resources")
Dim symbols As BrowserNode
Set symbols = recources.BrowserNodes.Item("Sketch Symbols")
' Replace "MySketchedSymbol" with the name of the sketched symbol name that you want to place.
Dim mySketchedSymbol As BrowserNode
Set mySketchedSymbol = symbols.BrowserNodes.Item("MySketchSymbol")
mySketchedSymbol.DoSelect
Dim cd As ControlDefinition
Set cd = ThisApplication.CommandManager.ControlDefinitions.Item("DrawingSketchSymbolInsertCtxCmd")
cd.Execute
Manual Add Sketch Symbol - moves with drawing view
Code add Sketch Symbol - doesnt move with drawing view
Thanks
Nacho
Automation & Design Engineer
Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Hey
When i add a sketch Symbol manually to my drawing over a drawing view, it stays attached to the drawing view if i move it. If i do the exact the same in code by placing the Sketch Symbol to the mouse pointer and placing it in the same position, it doesnt. When i place the Sketch Symbol at a predetermined point over the drawing view, it doesnt attach either. How can i get it to attach to the drawing view so that when the view is moved, thew Sketch Symbol also moves?
Code to attach
Dim doc As DrawingDocument
Set doc = ThisApplication.ActiveDocument
Dim modelPane As BrowserPane
Set modelPane = doc.BrowserPanes.Item("DlHierarchy")
Dim recources As BrowserNode
Set recources = modelPane.TopNode.BrowserNodes.Item("Drawing Resources")
Dim symbols As BrowserNode
Set symbols = recources.BrowserNodes.Item("Sketch Symbols")
' Replace "MySketchedSymbol" with the name of the sketched symbol name that you want to place.
Dim mySketchedSymbol As BrowserNode
Set mySketchedSymbol = symbols.BrowserNodes.Item("MySketchSymbol")
mySketchedSymbol.DoSelect
Dim cd As ControlDefinition
Set cd = ThisApplication.CommandManager.ControlDefinitions.Item("DrawingSketchSymbolInsertCtxCmd")
cd.Execute
Manual Add Sketch Symbol - moves with drawing view
Code add Sketch Symbol - doesnt move with drawing view
Thanks
Nacho
Automation & Design Engineer
Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Was the view pre-selected when you manually placed the SketchedSymbol on it?
Getting text & symbols to 'attach' to DrawingViews is tricky. Sometimes it works, and other times it doesn't work.
What I normally do to get text & symbols to 'attach' to a view (so it moves with the view) I use the leader. When you manually place a Leader Text, and attach it to a drawing curve segment within a view, then delete the leader, it will stay where you placed it in relation to the view. Then you an manually reposition the text as needed, and it will maintain its link to the view. Same goes for symbols. I don't usually use leaders with my symbols, but I do when I want them to stay with a view object. The leader can be turned off afterwards.
Wesley Crihfield
(Not an Autodesk Employee)
Was the view pre-selected when you manually placed the SketchedSymbol on it?
Getting text & symbols to 'attach' to DrawingViews is tricky. Sometimes it works, and other times it doesn't work.
What I normally do to get text & symbols to 'attach' to a view (so it moves with the view) I use the leader. When you manually place a Leader Text, and attach it to a drawing curve segment within a view, then delete the leader, it will stay where you placed it in relation to the view. Then you an manually reposition the text as needed, and it will maintain its link to the view. Same goes for symbols. I don't usually use leaders with my symbols, but I do when I want them to stay with a view object. The leader can be turned off afterwards.
Wesley Crihfield
(Not an Autodesk Employee)
Hey
I managed to resolve this by placing a sketch point above the sketch symbol that would be placed on top of the view thus attaching it to the view
Thanks
Nacho
Automation & Design Engineer
Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Hey
I managed to resolve this by placing a sketch point above the sketch symbol that would be placed on top of the view thus attaching it to the view
Thanks
Nacho
Automation & Design Engineer
Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Can't find what you're looking for? Ask the community or share your knowledge.