Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Greetings!
I'll just outright explain what I need and then explain what I'm trying.
I need to indicate in a drawing sheet its size. Thus, if it's A4, then I want to appear somewhere on the screen: "A4 210x297".
What I'm trying to do is: making a piece of code that reads what's the name of the sheet format and changes a parameter. Then I wanted to change a text field based on that parameter. I failed on my first step, so I came here before even trying the second one.
So, if you may help me, I wanted to ask two things:
- Is there a easier way to do this? Mind you, I wanted it to be completely automated: we already have 5 different sheet formats with different sizes.
- Regardless if there is, I'd like to do this with iLogic and VBA because I wanted to learn. Is there a way to do this?
- Proceeding with this code, how do I go about changing a text field based on a parameter I created? I have a parameter called test. Can I simply go on about a particular field and set it for its contet to be the same value as parameter 'test'? I have NO clue as to how to go about this.
My code was a rule I created with this written:
Sub main() Sheet_size = ThisDrawing.ActiveSheet.Name Parameter(test) = text_return(Sheet_size) End Sub Function Sheet_size(sheet As String) As String If sheet Is "A4" text = "A4 xx.xx" End If End Function
Trying this returns me with an error: Parameter: Could not find a parameter named: ""
I'm currently in a A4 sized sheet.
Solved! Go to Solution.