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: 

General Notes Formatted Text - Linked Parameter Bug

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
matt_jlt
788 Views, 5 Replies

General Notes Formatted Text - Linked Parameter Bug

There seems to be an issue with the formatted text for general notes. You can only add a linked parameter if it is for a part file and not an assembly.

The below code works only if there are no assemblies on the drawing sheet. As soon as you put one on there, this code crashes every time.

I am trying to make a note with numerous links for an assembly files, but this bugs means that you cannot create linked parameters for assemblies. Does anyone have a work around that doesn't involve manually linking all of the files?

 

thanks, Matt.

 

Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet = oDoc.ActiveSheet
Dim oGNs As GeneralNotes = oSheet.DrawingNotes.GeneralNotes
Dim oTG As TransientGeometry = ThisApplication.TransientGeometry

Dim sText As String = "Drawing Notes"

Dim oNoteB As GeneralNote = oGNs.AddFitted(oTG.CreatePoint2d(5, 18), "sText")
oNoteB.FormattedText = "TEST <Parameter Resolved='True' ComponentIdentifier='C:\temp\test.ipt' Name='THK' Precision='2'></Parameter>"
5 REPLIES 5
Message 2 of 6
HideoYamada
in reply to: matt_jlt

Hello Matt,

 

It seems working with an assembly for me.

Would you upload sample files and tell us what parameter you need?

 

=====

Freeradical

 Hideo Yamada

 

=====
Freeradical
 Hideo Yamada
https://www.freeradical.jp
Message 3 of 6
matt_jlt
in reply to: HideoYamada

Hi Hideo, Thanks for your reply. There are many parameter names and types i have tried, none seem to work.

I have tried with both custom and default assembly templates that come with inventor and have had no success. Any files I attach would just be the default ones that come with Inventor.

I have tried marking the parameters as exported + key, changing the units, changing parameter name etc. but nothing has worked. Even if i am referencing a part document and there is an assembly document on the sheet it crashes. Delete the assembly and the part reference works.

 

I probably should have mentioned my Inventor version, might have been fixed in a different / newer version.

Inventor Pro 2019 Build 330 / 2019.4

Windows 10

 

Thanks, Matt.

Message 4 of 6
HideoYamada
in reply to: matt_jlt

Hello Matt,

 

Perhaps I don't understand what your problem is exactly.

 

This code is working, but your problem is existing at another region.

(The code is for VBA.)

Option Explicit

Sub AddGeneralNotes()
    Dim oDoc As DrawingDocument: Set oDoc = ThisApplication.ActiveDocument
    Dim oSheet As Sheet: Set oSheet = oDoc.ActiveSheet
    Dim oGNs As GeneralNotes: Set oGNs = oSheet.DrawingNotes.GeneralNotes
    Dim oTG As TransientGeometry: Set oTG = ThisApplication.TransientGeometry
    
    Dim oNoteB As GeneralNote
    Set oNoteB = oGNs.AddFitted(oTG.CreatePoint2d(5, 18), "sText")
    
    Dim assyPath As String
    assyPath = oSheet.DrawingViews(1).ReferencedDocumentDescriptor.FullDocumentName
    
    oNoteB.FormattedText = "TEST <Parameter Resolved='True' ComponentIdentifier='" & assyPath & "' Name='TestParam' Precision='2'></Parameter>"
End Sub

Sample documents are attached to this post and the code above is also stored in CubeAssy.idw.

Please tell me what is different from your issue.

 

Best Regards,

 

=====

Freeradical

 Hideo Yamada

 

=====
Freeradical
 Hideo Yamada
https://www.freeradical.jp
Message 5 of 6
matt_jlt
in reply to: HideoYamada

Thanks Hideo,

I downloaded your files but i am only Running Inventor 2019 at the moment. I did test out your code and it throws the same type of error as i get with my ilogic code. I guess it answers my question then, that there is a bug in Inventor for 2019 but it has been fixed in 2020.

 

Thanks again, Matt.

 

 

Message 6 of 6
HideoYamada
in reply to: matt_jlt

Hello Matt,

 

I tried on my Inventor 2019 and could reproduce your problem.

This seems to be caused the bug it is still remaining Inventor 2019 as you mentioned...

 

I checked that the drawing document causing error with Inventor 2019 works fine with Inventor 2020.

 

=====

Freeradical

 Hideo Yamada

 

=====
Freeradical
 Hideo Yamada
https://www.freeradical.jp

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

Post to forums  

Autodesk Design & Make Report