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: 

Ilogic ~ switch German Sketch Symbols to English Version...

31 REPLIES 31
SOLVED
Reply
Message 1 of 32
mdavis22569
942 Views, 31 Replies

Ilogic ~ switch German Sketch Symbols to English Version...

I'm trying to get more stuff sourced in the US, but all of my notes, finishes etc are in German. I need to get them to easily change over to English at a click of the button (code) if possible.  If not I'll have to make 2 drawings for each, one in English and one in German ..which I'm trying to avoid. 

 

 

 

Is it possible to have an ilogic code that would switch say Column A to Column B? (German notes to English ones) 

 

I would have 2 folders under my Drawing Resources/Sketched Symbols   One folder English, one German.  

 

I would also be changing the title block to an English version too ... 

 

I can provide a copy of the IDW if needed (but I'd like to learn to do it myself) 

 

 

a to b.PNG

 

Thank you for the help,

 

Mike 


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------
Mike Davis

EESignature

31 REPLIES 31
Message 2 of 32
mdavis22569
in reply to: mdavis22569

Ok I have can change the titleblocks now ...

 

now how to swap sketch symbols....

 

 

 


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------
Mike Davis

EESignature

Message 3 of 32
mdavis22569
in reply to: mdavis22569

Anyone ?  ...


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------
Mike Davis

EESignature

Message 4 of 32
LukeDavenport
in reply to: mdavis22569

Hi mdavis,

You want to place the German and English notes each on their own new drawing layer. Then use the standard iLogic snippet for turning the visibility of a layer on and off:

 

SyntaxEditor Code Snippet

ThisDrawing.Document.StylesManager.Layers("German Note").Visible = False 
ThisDrawing.Document.StylesManager.Layers("English Note").Visible = True

 Cheers

Luke

Message 5 of 32
mdavis22569
in reply to: LukeDavenport

I like that ...just hoping I wouldn't have to put the notes in twice.

 

 

I'm hoping there is a way to put it in ..then if this equals say German Note 1, when I run the code it would change it to English Note 1. 


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------
Mike Davis

EESignature

Message 6 of 32
LukeDavenport
in reply to: mdavis22569

Another way of doing it would be simply to add the text string as an
iProperty. Then you can reference the iProperty on your drawing note,
and just switch the iProperty value using a switching parameter (like
'DrawingNoteLanguage' as shown below).



*If* DrawingNoteLanguage *=* "English" *Then*

*iProperties*.*Value**(*"Custom", "DrawingNoteText"*)* *=* "This is an
English note..."

*Else*

*iProperties*.*Value**(*"Custom", "DrawingNoteText"*)* *=* "dies ist
ein Deutsch Hinweis..."

*End If*
Message 7 of 32
LukeDavenport
in reply to: mdavis22569

Another way of doing it would be simply to add the text string as an iProperty. Then you can reference the iProperty on your drawing note, and just switch the iProperty value using a switching parameter (like 'DrawingNoteLanguage' as shown below).

 

If DrawingNoteLanguage = "English" Then

iProperties.Value("Custom", "DrawingNoteText") = "This is an English note..."

Else

iProperties.Value("Custom", "DrawingNoteText") = "dies ist ein Deutsch Hinweis..."

End If

Message 8 of 32
mdavis22569
in reply to: LukeDavenport

Ilogic isn't my best area of Inventor ..so I'll try to figure this out with your code's Luke. I will probably have more questions..

 

Just wishing there was a way to switch out sketch symbols from G to E easier.

 

 

Thank you too for the help

 

Mike 


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------
Mike Davis

EESignature

Message 9 of 32
LukeDavenport
in reply to: mdavis22569

Don't be scared of the codes Michael. Its easy with Uncle Google's help!

Message 10 of 32
mdavis22569
in reply to: LukeDavenport

I'm trying to find the term for the sketchsymbol change ... .TitleBlock was easy ..but this sketch symbol changing is annoying me

 

 

and ty! Luke ..lol I do appreciate the help though

 

 


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------
Mike Davis

EESignature

Message 11 of 32
mdavis22569
in reply to: mdavis22569

Ok ... I've now become lost. This is the 3time I've ever tried Ilogic. 

 

So I have no idea how to add the string..

 

*If* DrawingNoteLanguage *=* "English" *Then*

*iProperties*.*Value**(*"Custom", "DrawingNoteText"*)* *=* "This is an
English note..."

*Else*

*iProperties*.*Value**(*"Custom", "DrawingNoteText"*)* *=* "dies ist
ein Deutsch Hinweis..."

*End If*

 

 

I'm probably going to get dinged for all the googling time on my browser during work hours ...

 

 

 

 

 

 

 

 

 


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------
Mike Davis

EESignature

Message 12 of 32
LukeDavenport
in reply to: mdavis22569

 

Haha Michael. That sounds familiar. 

 

5 stages:

 

1) Create a custom iProperty called DrawingNoteText. Make the value "This is an English Note" (for now)

2) Create a drawing note and reference this iProperty in it. (So the note will say 'This is an English Note')

3) Create a text parameter in the drawing file called DrawingNoteLanguage (access parameters in normal way - Manage - Parameters). Make it multi-value with values of 'English' and 'German'

4) Paste the code in my previous post into a new iLogic rule. (Not sure where all those * symbols appeared from - get rid of all those!!)

5) Try switching the DrawingNoteText parameter in parameters dialogue box (or add it to a form for easier access)

 

Job done?

 

Message 13 of 32
mdavis22569
in reply to: LukeDavenport

I can do that for here ... 

 

Unfortunately I don't think the German HQ (who controls everything IV) will let me change all of the notes to have an Iproperty tag in it.   I'll show them and cross my fingers.  So far I've sneaking this all in on myside 

 


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------
Mike Davis

EESignature

Message 14 of 32
mdavis22569
in reply to: mdavis22569

Ok ...what did I do wrong?

 

Thank you too!

 

 

 


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------
Mike Davis

EESignature

Message 15 of 32
LukeDavenport
in reply to: mdavis22569

 

All looks good to me. I think you've just copied and pasted the iLogic text in with some of the * symbols. Those aren't supposed to be there. Does the rule look exactly like this?

 

If DrawingNoteLanguage = "English" Then

iProperties.Value("Custom", "DrawingNoteText") = "This is an English note..."

Else

iProperties.Value("Custom", "DrawingNoteText") = "dies ist ein Deutsch Hinweis..."

End If

Message 16 of 32
mdavis22569
in reply to: LukeDavenport

Ok that flipped ..

 

Problem is now I would need to a note for each of these right?

 

etog.PNG    etog2.PNG


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------
Mike Davis

EESignature

Message 17 of 32
mdavis22569
in reply to: mdavis22569

PS ...I truly appreciate the help. (I'll probably say that a few more times before this is finished ..lol)


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------
Mike Davis

EESignature

Message 18 of 32
mdavis22569
in reply to: mdavis22569

 

Some how I'm missing something in the code to get this to work ...

 

I also have this error:

 

 

sketch.PNG

 

 

SyntaxEditor Code Snippet

If SketchSymbol.IsActive("anodize")=True Then current = 1
If SketchSymbol.IsActive("Ra3.2_eloxiert")=True Then current = 2

If SketchSymbol = 1 And current = 2 Then SketchSymbol.Replace("anodize", "Ra3.2_eloxiert", True) 
If SketchSymbol = 2 And current = 1 Then SketchSymbol.Replace("Ra3.2_eloxiert", "anodize", True)

 

 

 


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------
Mike Davis

EESignature

Message 19 of 32

Hi Michael,

 

The funcitions of iLogic are wrapped from Inventor API. iLogic does not wrapp functions for all objects and scenarios. there is not a function namd 'SketchedSymbol'. you will need to use Inventor API in iLogic. e.g.

 

 

 ' Set a reference to the drawing document.
    ' This assumes a drawing document is active.
    oDrawDoc = ThisApplication.ActiveDocument
    oSheet = oDrawDoc.ActiveSheet
    
    Dim oEachSymbol As sketchedSymbol    
    For Each oEachSymbol In oSheet.SketchedSymbols
        If oEachSymbol.Definition.Name = "anodize" Then
            'current  = 1
	      MessageBox.Show("Message", "Title")

        End If
        
    Next
    

Please refer to API help for more details:   <Inventor Install Path>\Local Help\admapi_*_0.chm

 

Message 20 of 32

....Hand to the forehand and I raise the white flag.  

 

I don't see this being something I can get done easily.   I was hoping for a way to just make replace symbol like the replace component.

 

 

Going to go back to the 2 text, different layer and see if this might work. (edited to add)   It doesn't look like the 2 layers for the symbols will work. I can't control the text layer in the symbol itself. I was hoping that Maybe I could put both text in there, 2 different layers and turn on and off the ones I need.   At this point it just looks easier to just add German note for the German side, and English notes for the English, it's just not an easy "Click of a button" like I was hoping to happen.

 

 

 

 

 

SMH ...

 

 

Mike


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------
Mike Davis

EESignature

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

Post to forums  

Autodesk Design & Make Report