Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is a custom, pre-filled-out, leader possible? Maybe a Sketch Symbol?

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
jeanchile
467 Views, 7 Replies

Is a custom, pre-filled-out, leader possible? Maybe a Sketch Symbol?

Hello all,

 

It's been a while since I've been here, but I have something I can't figure out on my own and I need the forum geniuses that have been so helpful to me in the past.

 

In the drawings I create, a lot of the times I need to have a leader pointing to something and have that leader say two things: the description, and the material grade (see pic attached). The "description" information comes from the standard iProperty and the "material grade" comes from a custom iProperty that is in every part file we create.

 

My usual process is this: I start the leader command, select the part in the drawing, hit continue and in the "Format Text" dialog box I use the iProperties drop down menu to select the category (Properties - Model) and the iProperty (DESCRIPTION) and then hit the "Add Text Parameter" button to populate the dialog box with the information needed (then use the same process for the "Custom Properties - Model" for the material).

 

This process is not difficult but there are some projects where I need to perform this operation literally a hundred times on just one drawing. In an effort to streamline this, I looked into creating a custom "balloon" and tried to obtain a solution using that method but was unimpressed with the results. Specifically, the leader never terminated at the text box the way I wanted. If I purposely "clicked" to create a leader "extension" (or whatever that straight portion of leader is called just before the text) I could make it look right but when/if I needed to edit the view, move the information, whatever...    it made the whole process messier.

 

My question/issue: Is it possible somehow to create say a custom leader style that is already populated with the two iProperties I need, that has the normal "extension" before the text box, that remains linked to the iProperties so if they're edited, the leader information will update, that will change sides easily so if the leader moves from the right hand side of the part to the left hand side of the part, the text justification will change from left to right and the leader "extension" will switch sides, etc? I'm trying to turn a 19-click process into a 5-click process (1900 clicks vs. 500 clicks for every large drawing I create). Is this possible somehow?

 

Thanks again for your help.

 

J...

Inventor Professional
7 REPLIES 7
Message 2 of 8
SBix26
in reply to: jeanchile

I think this will do what you want-- attached symbol library (Inventor 2024 format) contains one symbol which grabs two iProperties from whatever part it's attached to.  In the image below, the lower label is Label Text, created as you describe in your post.  The upper one is the sketch symbol.  The horizontal line is part of the sketch symbol, so it can be configured to your liking.

SBix26_0-1685632417022.png


Sam B

Inventor Pro 2024.0.1 | Windows 10 Home 22H2
autodesk-expert-elite-member-logo-1line-rgb-black.png

Message 3 of 8
jeanchile
in reply to: SBix26

Thank you Sam. Unfortunately I can't open your drawing at the moment (we're performing our Software Implementation Study on v2024 right now in anticipation of upgrading later this month, but we are currently stuck on IV2021). I understand the difference in the two versions you've posted though and perhaps you can answer two questions about your sketch symbol for me, and once I have your input, I'll get to creating one of my own and testing it out. The two questions are:

 

 1.) You mention below that "The horizontal line is part of the sketch symbol". Is this line permanently fixed to the left side of the text box (i.e. if I move that symbol over to the left side of your geometry, does the line jump to the other side like a normal leader with text would)? I'm trying to determine if we would need more than one symbol to do this and if so, what the "editing process" looks like if we need to move a symbol on a drawing (e.g. would we have to delete the RH version and reinsert a LH version or is there an easier way to switch symbols).

 

2.) How does the text react if the same situation in question one applies (i.e. can the text automatically shift its justification from right to left to accommodate editing)? Obviously, if the horizontal line won't shift when editing, then it doesn't matter if the text won't jump justification, as we're going to end up with more than one symbol anyway.

 

Thanks again for your help. You've been a valuable part of this community for quite some time and I, for one, appreciate it immensely.

Inventor Professional
Message 4 of 8
A.Acheson
in reply to: jeanchile

Hi @jeanchile 

While a sketch symbol in theory works the implementation of the leader was forgotten so it doesn't behave like a leader text so it doesnt automatically swap from one side to another. I had some implemented but because I had to effectively make a left and right of everything it became a huge hassle. I would suggest to do this in ilogic with a leader text. 

 

Here is some code to add a leader from this source here. It might look a bit daunting but there is only one line in there containing the text so that's all that needs to be edited. The alternative is lots of copying and pasted which are a nightmare with leaders. 

Sub main AddLeaderNote()
    ' Set a reference to the drawing document.
    ' This assumes a drawing document is active.
    Dim oDrawDoc As DrawingDocument
    oDrawDoc = ThisApplication.ActiveDocument

    ' Set a reference to the active sheet.
    Dim oActiveSheet As Sheet
    oActiveSheet = oDrawDoc.ActiveSheet

    ' Set a reference to the drawing curve segment.
    ' This assumes that a drawing curve is selected.
    Dim oDrawingCurveSegment As DrawingCurveSegment
    oDrawingCurveSegment = oDrawDoc.SelectSet.Item(1)

    ' Set a reference to the drawing curve.
    Dim oDrawingCurve As DrawingCurve
    oDrawingCurve = oDrawingCurveSegment.Parent

    ' Get the mid point of the selected curve
    ' assuming that the selected curve is linear
    Dim oMidPoint As Point2d
    oMidPoint = oDrawingCurve.MidPoint

    ' Set a reference to the TransientGeometry object.
    Dim oTG As TransientGeometry
    oTG = ThisApplication.TransientGeometry

    Dim oLeaderPoints As ObjectCollection
    oLeaderPoints = ThisApplication.TransientObjects.CreateObjectCollection

    ' Create a few leader points.
    Call oLeaderPoints.Add(oTG.CreatePoint2d(oMidPoint.X + 0.5, oMidPoint.Y - 0.5))
    'Call oLeaderPoints.Add(oTG.CreatePoint2d(oMidPoint.X + 10, oMidPoint.Y + 5))

    ' Create an intent and add to the leader points collection.
    ' This is the geometry that the leader text will attach to.
    Dim oGeometryIntent As GeometryIntent
    oGeometryIntent = oActiveSheet.CreateGeometryIntent(oDrawingCurve)

    Call oLeaderPoints.Add(oGeometryIntent)

    ' Create text with simple string as input. Since this doesn't use
    ' any text overrides, it will default to the active text style.
    Dim sText As String
    sText = "Measure<Br/>here"

Dim oLeaderNote As LeaderNote
    oLeaderNote = oActiveSheet.DrawingNotes.LeaderNotes.Add(oLeaderPoints, sText)
    oLeaderNote.VerticalJustification = 25601

    ' Insert a node.
    Dim oFirstNode As LeaderNode
    oFirstNode = oLeaderNote.Leader.RootNode.ChildNodes.Item(1)

    'Dim oSecondNode As LeaderNode
    'oSecondNode = oFirstNode.ChildNodes.Item(1)

End Sub

 You can also add iproperty formatted text.

'define model property values
oDescription = "<Property Document='model' PropertySet='Design Tracking Properties' Property='Description'>DESCRIPTION</Property>"

oLeaderNote.FormattedText = oDescription
		
	

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 5 of 8
SBix26
in reply to: jeanchile

As you suspected, it would require a left justified and right justified version, which would need to be deleted and re-inserted in order to change sides.  I'll try to reproduce it in 2021 tomorrow.


Sam B

Inventor Pro 2024.0.1 | Windows 10 Home 22H2
autodesk-expert-elite-member-logo-1line-rgb-black.png

Message 6 of 8
jeanchile
in reply to: SBix26

Thank you Sam (and Alan). It seems like the iLogic route is the way we'll end up going. Not proficient at iLogic at all and definitely need some education in that department, but to get the tool we're looking for to function like we want, that's our route to go. I created a quick sketch symbol like you suggested but still having issues getting the leader to "connect" to the end of the horizontal line segment so that it looks right, so I'll likely abandon it for now until I'm more of an iLogic user.

 

We're in the process of setting up the upgrade to 2024 and when we do, I'll come back and take a look at your example to learn some things.

 

Thanks again though!

Inventor Professional
Message 7 of 8
Frederick_Law
in reply to: jeanchile

Leader in Symbol start at center of Symbol.

You need to add vertex to Leader and drag that to right or left or top or bottom of Symbol.

Message 8 of 8
SBix26
in reply to: jeanchile

I'm away from my Inventor computer for a week so I can't demonstrate, but I solved the leader issue by adding a connection point to the location on the sketch symbol where I wanted the leader to connect.  As I recall from a few weeks ago, as soon as I saved the change to the symbol, the symbol on my drawing jumped instantly to that connection point, no need to place the symbol again.


Sam B

Inventor Pro 2024.0.1 | Windows 10 Home 22H2
autodesk-expert-elite-member-logo-1line-rgb-black.png

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report