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: 

sketch Symbol - Attached to

2 REPLIES 2
Reply
Message 1 of 3
NachitoMax
341 Views, 2 Replies

sketch Symbol - Attached to

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

manual add.gif

 

Code add Sketch Symbol - doesnt move with drawing view

code add.gif

 

Thanks

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


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.


2 REPLIES 2
Message 2 of 3
WCrihfield
in reply to: NachitoMax

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

EESignature

(Not an Autodesk Employee)

Message 3 of 3
NachitoMax
in reply to: WCrihfield

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

EESignature


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.

Post to forums  

Autodesk Design & Make Report