Hello,
I can't for some reason get this rule to work, simply want to be able to choose what title block to use.
I created a text parameter with the multi-values: TES ELE and TES EQU
I have 2 title blocks in my template called TES ELE and TES EQU
Here is my code, basically, I want to rule to apply the title block based on the selection, which will be done on a form.
If Title = "TES ELE" Then ActiveSheet.TitleBlock = "TES ELE" ElseIf Title = "TES EQU" Then ActiveSheet.TitleBlock = "TES EQU" End If InventorVb.DocumentUpdate() ThisApplication.ActiveView.Fit
I have found many threads in this forum and have used their solutions for this rule, but for some reason, my rule will not select the title block and place it in the drawing.
Here is a snap of my set-up and my template file is attached
Thanks!
Solved! Go to Solution.
Solved by mikejones. Go to Solution.
Hi Sean
You need to specify the parameter call
If Parameter ("Title") = "TES ELE" Then
ActiveSheet.TitleBlock = "TES ELE"
ElseIf Parameter ("Title") = "TES EQU" Then
ActiveSheet.TitleBlock = "TES EQU"
End If
InventorVb.DocumentUpdate()
ThisApplication.ActiveView.Fit
Mike
Hey Mike, I tried this as well and I still get errors when trying to run the rule??
I used this code and there is properly named title blocks in my drawing template and a text parameter with the matching values as well.
If Parameter ("Title") = "TES ELE - A" Then ActiveSheet.TitleBlock = "TES ELE - A" ElseIf Parameter ("Title") = "TES ELE - B" Then ActiveSheet.TitleBlock = "TES ELE - B" ElseIf Parameter ("Title") = "TES EQU - A" Then ActiveSheet.TitleBlock = "TES EQU - A" ElseIf Parameter ("Title") = "TES EQU - B" Then ActiveSheet.TitleBlock = "TES EQU - B" End If InventorVb.DocumentUpdate() ThisApplication.ActiveView.Fit
I don't understand, haha, why won't the rule display the selected title block?
Thanks!!
Sean there is a different call for tilte blocks which contain prompted entries
ActiveSheet.SetTitleBlock("Other Title Block", "promptedEntry1", "promptedEntry2")
Mike
Hey Mike,
I just got rid of the prompted entry and used the comments iproperty in the model to insert the info that i need.
That being done, the rule didn't work, but there was no errors, so I changed the rule code back to this:
If Title = "TES ELE - A" Then ActiveSheet.TitleBlock = "TES ELE - A" ElseIf Title = "TES ELE - B" Then ActiveSheet.TitleBlock = "TES ELE - B" ElseIf Title = "TES EQU - A" Then ActiveSheet.TitleBlock = "TES EQU - A" ElseIf Title = "TES EQU - B" Then ActiveSheet.TitleBlock = "TES EQU - B" End If InventorVb.DocumentUpdate() ThisApplication.ActiveView.Fit
and it now works.
I just need to create a rule now that will prompt my Form once the drawing template is opened and I can select my drawing sheet parameters: Units -> Sheet Size -> Company Title Block
Thanks for your help Mike!!
Hi,
I have a similar task: to choose one of two title blocks depending on a parameter entered in a form. My iLogic rule:
iLogicForm.Show("Drawing parameters") If TitleBlock = "A" Then ActiveSheet.TitleBlock = "TitleBlock A" ElseIf TitleBlock = "B" Then ActiveSheet.TitleBlock = "TitleBlock B" End If
It works, but the problem is that I have to run the rule 2 times to change a title block. When I run the rule for the first time with changed parameter "TitleBlock" it doesn't change the title block. After second run it changes. Why this problem appears?
Yea I was kind of ignoring this issue, but or some reason, when you open your template, if the titleblock you want is the one that is already selected upon opening you have to pick the other titleblock then re-pick the initial titleblock, I don't know how to bypass this or this made sense.
In my example I have 4 different titleblock,
when I open the drawing template Elect A is first in the list(first by default)
If I want any of the other 3 titleblocks, the rule runs fine, but if I do in fact want Elect A to be the titleblock, it won't apply on the first run of the rule, I have to select one of the other 3, then apply, then re-select Elect A and press apply to get that titleblock.
The only solution I could think of was to create another blank parameter(titleblock), and make sure that one is selected first by default then if I want Elect A is would apply on first try..
hmmm..I do have a separate rule for the form to show...I would upload my template but it is 2014, do you have that?
I created a short (30sec video) of what I mean,
This can be seen in the video uploaded in the link here: http://screencast.com/t/JrAwBrweOydv
This also wasn't a major concern, because I don't always create Equipment B drawings, (roughly 25% of the time) so if/when I do create an Equipment B drawing, I just use the work around as seen in the video, only takes a few seconds.
That being said, if there is a simple solution to this, I would apply it.
Thanks!
Yea, he posted something saying were not talking about the same issue, I thought it was for some reason, anyways, here is my template file,
Thanks
Thanks! I made a separate rule for the form and it works now. But the other problem appears - I want the form to disappear after pressing a button. How to implement this?
P.S. I've posted a message before reading your answers, but when I read your answer I removed my post. You are replying quite quick.
I made some changes. See how this works. It is a similar problem to 2211285's.
Edit: Forgot to attach.
Yup! that update button works much better than the apply button!
Thanks!!
Only thing left I would like to do is play with the images, not sure if you noticed by the template is 1.2MB with no views on it...
I know the template has a bunch of iLogic in it, but the images are not the best either. I deleted the images from the template completely and the size dropped to 500kb...I heard something rumored about using vector images instead of bmp, but I'll look into that another day.
For now this template has been working great!!
Thanks again Mike!