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)
Thank you for the help,
Mike
Solved! Go to Solution.
Solved by MechMachineMan. Go to Solution.
Ok I have can change the titleblocks now ...
now how to swap sketch symbols....
Anyone ? ...
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
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.
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
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
Don't be scared of the codes Michael. Its easy with Uncle Google's help!
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
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 ...
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?
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
Ok ...what did I do wrong?
Thank you too!
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
Ok that flipped ..
Problem is now I would need to a note for each of these right?
PS ...I truly appreciate the help. (I'll probably say that a few more times before this is finished ..lol)
Some how I'm missing something in the code to get this to work ...
I also have this error:
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)
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
....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