Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Project Name In Title blocks

25 REPLIES 25
SOLVED
Reply
Message 1 of 26
pgcust
3668 Views, 25 Replies

Project Name In Title blocks

I would like my IDW template to have the project name in the title block when it opens. is there a way to automate this?

 

Thanks

Chris

iv 2010

25 REPLIES 25
Message 2 of 26
Dennis_Jeffrey
in reply to: pgcust

I'm assuming that you do not want to add the project file name to the drawing sheet.  Everyone should be using the Single project file approach by now.

 

You can edit the title block in your template to include any iProperty, including custom iProperty values as a text field. The value will not appear until you create the iProperty, either in the IDW or in the Model.

 

 

Please mark this response as "Accept as Solution" if it answers your question.
____________________________________________________________
Dennis Jeffrey, Author and Manufacturing Trainer, Autodesk Inventor Certified Expert
Autodesk Manufacturing Implementation Certified Expert
Autodesk Silver Manufacturing Partner

Subscribe to the free digital "The Creative Inventor Magazine" now available at: http://teknigroup....

XP64 SP2, GeForce 9800GT-1GB, Driver: 6.14.12.7061, 8GB Ram, AMD Athlon II 3.2 Ghz
Laptop: Win7-64 Pro, 4GB, ATI Graphics on board, 2012 Ultimate, IV2011 or 2010 Pro, all SP's
Message 3 of 26
pgcust
in reply to: Dennis_Jeffrey

Dennis,

I use a single project file for every job. I would like to use the project name in the title block for all the IDWs for this project. At the moment this only happens if i fill in the iProperties manually on every IDW. Can this be done ? If i Create the iproperty in the multi body part,should this appear in the IDW automatically.

 

 

Chris

Message 4 of 26
jtylerbc
in reply to: pgcust

Chris,

 

Yes, what you want is possible.  Assuming you want all of your drawings to do this:

 

In your template, go into Document Settings.  On the Drawing tab, click "Copy Model iProperty Settings."  Check the box to enable copying, then select the properties you want it to copy (in this case, at least Project.).  After doing this, when you create a drawing, the chosen properties will be copied over from the model's iProperties to those of the drawing.

 

To actually get it to show on the drawing, do as Dennis described, adding a text box referring to the Project iProperty to your title block.  The Project name will then fill in automatically when you create a drawing if you had it filled out in the model.

 

 

Message 5 of 26
Curtis_Waguespack
in reply to: pgcust

Hi pgcust,

 

Do you happen to have the iLogic addin with Inventor 2010? If so I have a solution to read in the project file name and write it to the part iproperties automatically when the file is saved, etc. Then you could have your titleblock call that iproperty as others have mentioned.

 

I hope this helps.

Good luck with all of your Inventor pursuits,

Curtis

http://inventortrenches.blogspot.com/

Message 6 of 26
ksjack
in reply to: Curtis_Waguespack

This solution sounds perfect for our setup. Can you provide a link to that method?

 

Thanks,

 

Jack

Message 7 of 26
jtylerbc
in reply to: ksjack

Here is the link to Curtis's blog post where he describes the iLogic method for getting the project file name.

 

http://inventortrenches.blogspot.com/2012/07/ilogic-and-inventor-project-file.html

 

When I responded to this thread previously, I was still on Inventor 2010 with no iLogic.  I now use a slightly modified version of his rule, which converts the retrieved name to all uppercase letters and puts the retrieved project file name into the Project iProperty instead of a message box.

 

My version of the rule is shown below.  I have the rule in my drawing template, with a trigger set for "New Document."  With this trigger, the rule will only run on initial creation of the drawing.  That way, if you have some exception that you have filled out manually in your iProperties, it won't keep overwriting it with the project file name.  If I run into a situation where the project name has changed and I want to update it in my drawing, I just run the rule manually.

 

 

Dim IPJ as String
Dim IPJ_Name As String
Dim IPJ_Path As String
Dim FNamePos As Long
'set a reference to the FileLocations object. 
IPJ = ThisApplication.FileLocations.FileLocationsFile
'get the location of the last backslash seperator 
FNamePos = InStrRev(IPJ, "\", -1)     
'get the project file name with the file extension
IPJ_Name = Right(IPJ, Len(IPJ) - FNamePos) 
'get the project name (without extension)
IPJ_ShortName = Left(IPJ_Name, Len(IPJ_Name) - 4)
'get the path of the folder containing the project file
IPJ_Folder_Location = Left(IPJ, Len(IPJ) - Len(IPJ_Name))

'Converts the project file name to UPPER CASE
IPJ_Shortname = UCase(IPJ_Shortname)

iProperties.Value("Project", "Project") = IPJ_Shortname

iLogicVb.UpdateWhenDone = True

 

 

Message 8 of 26
Alex.booth
in reply to: jtylerbc

Hi

 

I've been looking to an answer for auto updating our borders automatically with the relevant job number. Currently the border is set as the Project iproperty of the model that is placed on the sheet, but it is needed to be added manually in every model for every part / assembly.

 

The above ilogic code looks ideal, but when using the Vault we use just a single project for everthing.

 

Is there a way to extract say the folder name from vault as we call our vault folder the project number.

 

The same as it can be done in Solidworks Workgroup PDM (Just for explanation for those who has experiance in it).

 

Regards   

 

Alex

 

Message 9 of 26
Mark.Lancaster
in reply to: Alex.booth

So use iLogic to extract the path name of the file and trunicate it to get the folder name that matches your project #.

Mark Lancaster


  &  Autodesk Services MarketPlace Provider


Autodesk Inventor Certified Professional & not an Autodesk Employee


Likes is much appreciated if the information I have shared is helpful to you and/or others


Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.

Message 10 of 26
Alex.booth
in reply to: Mark.Lancaster

That sounds great....

I know how to copy and paste...maybe make a minor alteration to someone elses VBA code. buts thats about it.

 

I thought it might be a common requirement to have this automated and there been a simple solution (or ilogic program) out there?

 

 

 

 

 

 

Message 11 of 26
mcgyvr
in reply to: Alex.booth

@Alex.booth

 

This should do it..

It will grab the folder and stick it in the project iproperty

Dim FolPos As Long
Dim Folder As String
Dim Fol1 As String

Folder = ThisDoc.Path
FolPos = InStrRev(Folder, "\", -1) 
Fol1 = Right(Folder, Len(Folder) - FolPos)

iProperties.Value("Project", "Project") = Fol1
'MessageBox.Show(Fol1, "The folder is")


iLogicVb.UpdateWhenDone = True


-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 12 of 26

 

Hi Alex.booth,

 

Here's a quick example.

 

Edit: @mcgyvr beat me to it!

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

 

'gets folder name from file 
'example: C:\TEMP\Projects\2015\PJ-123\Drawing-123.idw
'where the job is: PJ-123

'get the full path and name of the current file
oPath = ThisDoc.Document.FullFileName
'define backslash as the split character
Dim Split As String() = oPath.Split("\")
'split out just the folder/project name
Dim oJobName As String = Split(Split.Length - 2)
'write to the Project iProperty
iProperties.Value("Project", "Project") = oJobName
'display to user
MessageBox.Show("Job Number: " & oJobName, "iLogic")

 

Message 13 of 26

That works great. It was exactly what I was looking for.

 

Unfortunatley management doesn't like it, they argue that they often use sub folders in the vault, which would mean the -2 split length would input the wrong job number as there seems to be no control on folder creation inside the vault in our office.

Maybe if i could control the splits from the other end of the folder address I would be more convincing. Is that possible?

 

Alex

 

Message 14 of 26

Hi Alex.booth,

 

Well generally speaking I wouldn't suggest trying to add much in the way of automation if methods and procedures lack consistency, but it might be doable if the front end of the path is consistent. Can you provide example of the folder paths, so we can see how they vary?

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Message 15 of 26

We are an old engineering company that’s was founded in 1824! (not to mention some of the staff have been here for the duration. :-b)

It's only really recently (about 2012) that the company decided to invested in Inventor software.

The archive of drawings are impressive (although a little dusty). the earliest drawing I’ve spotted so far was dated 1911.

  

Anyway, my point been is that changing the way that the company archives drawings (even electronically) is not an easy task, we currently make work for ourselves by updating a drawing register (only recently moved from the a very old written book - to an excel spread sheet) as well as maintaining the Vault. I'm trying to convince management the Vault does what the old drawing register does, which we use just for generating a number and filtering out the Project Number when searching... But that’s a discussion for another day.

 

Looking on how the company structures its vault the job number remains constant from the left hand (start) of the folder path but not from the right (end). i.e. It currently looks like this. 

 

C:$VaultWorkingFolder/Designs/"Group_name"/"PROJECT NUMBER"/"Sub_Assembly"/"Smaller-Sub_Assy"/"Possible Smaller-Sub_Assy".

 

We make very large industrial machines so there is a requirement to organise the sub-assemblies into separate folders and convincing others to change that practice would be impossible.

 

 

Alex

 

 

 

 

Message 16 of 26
mcgyvr
in reply to: Alex.booth


@Alex.booth wrote:

We are an old engineering company that’s was founded in 1824! (not to mention some of the staff have been here for the duration. :-b)

It's only really recently (about 2012) that the company decided to invested in Inventor software.

The archive of drawings are impressive (although a little dusty). the earliest drawing I’ve spotted so far was dated 1911.

  

Anyway, my point been is that changing the way that the company archives drawings (even electronically) is not an easy task, we currently make work for ourselves by updating a drawing register (only recently moved from the a very old written book - to an excel spread sheet) as well as maintaining the Vault. I'm trying to convince management the Vault does what the old drawing register does, which we use just for generating a number and filtering out the Project Number when searching... But that’s a discussion for another day.

 

Looking on how the company structures its vault the job number remains constant from the left hand (start) of the folder path but not from the right (end). i.e. It currently looks like this. 

 

C:$VaultWorkingFolder/Designs/"Group_name"/"PROJECT NUMBER"/"Sub_Assembly"/"Smaller-Sub_Assy"/"Possible Smaller-Sub_Assy".

 

We make very large industrial machines so there is a requirement to organise the sub-assemblies into separate folders and convincing others to change that practice would be impossible.

 

 

Alex

 

 

 

 


So back to manual it is... If you have no consistency then programming can't help.. Unless you want some message boxes to pop up giving you a "is this the project name?" if no then it drops down a folder level and "is this the project name?" ,etc.. looping through each folder. 

 

Of course the "simple" solution is to just put the full path and and call it a day.. 



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 17 of 26
Alex.booth
in reply to: mcgyvr

I had the idea of just removing the trigger and have the ilogic rule in our drawing template to be run manually.

We currently use the same method to update the scale (We're still on 2015). This is because some draughtspersons prefer to leave the scale field blank.

 

It’s not so much the automation but the accuracy aspect that is favoured. A button click v's finding/remembering a number.

The folder name in the vault is never wrong, whereas the project number can get typed in wrong or forgotten to be updated when copying from a previous job.

Both ilogic rules here work great, but I'd need a separate rule depending on how many subfolders are used. i.e. one set to -2 one set to -3 etc....

If the split count could work from the other end it would be better as the "project folder" (Project Number) position remains constant.

 

 

 

 

Message 18 of 26

Hi Alex.booth,

 

Here's an example that splits the path by the backslash and then uses a specific number subdirectory to find the project number.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

 

'gets folder name from current file 
'where current file path is: 
'	C:\TEMP\MyWorkingFolder\Designs\Engineering\PJ-123\Sub_Assembly\Smaller-Sub_Assy\Possibl​e Smaller-Sub_Assy\Drawing-123.idw
'where the job is: PJ-123, and is always the 5th sub-directory

'get the full path and name of the current file
oPath = ThisDoc.Document.FullFileName
'define backslash as the split character
Dim Split As String() = oPath.Split("\")
'get the 4th item in the string array
Dim oGroupName As String = Split(4)
'get the 5th item in the string array
Dim oJobName As String = Split(5)
'write to the Project iProperty
iProperties.Value("Project", "Project") = oJobName
'display to user
MessageBox.Show("Group Name: " & oGroupName, "iLogic")
MessageBox.Show("Job Number: " & oJobName, "iLogic")
iLogicVb.UpdateWhenDone = True

 

Message 19 of 26

Perfect!

I couldn't understand why there was a need to search and display the parent folder though "Groupname". I left the code in but deleted the message line.

 

I have the template changed but I'd like to not upset the workflow for others before I swap it with the master one on the server.

Our current drawing template displays the project number from the model property not the drawing property.

 

 

Can the ilogic rule be run from the drawing to update the model property and if possible the drawing property as well?

Or will I need the ilogic rule in both the model and the drawing?

 

updating the model property would mean I would need to change the template, only add a manual ilogic rule.

 

Great work BTW. much appreciated.

 

Alex

 

Message 20 of 26

Hi Alex.booth,

 

The code for the Groupname was just for example purposes, and to make it clear how the split/strring array was working. You can remove those lines, as well as the message box for the job number.

 

Here's another example that sets the project iProperty in both the drawing and the model.

 

Note that you could run the rule from Post#18  from the model rather than the drawing and it would work just fine. There's nothing in that code that specifies the file type of the file the rule is run from (other than the code comments, which don't matter).

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

 

'gets folder name for the job from current file 
'where current file path is: 
'	C:\TEMP\MyWorkingFolder\Designs\Engineering\PJ-123\Sub_Assembly\Smaller-Sub_Assy\Possibl​e Smaller-Sub_Assy\Drawing-123.idw
'where the job is: PJ-123, and is always the 5th sub-directory

'get the full path and name of the current file
oPath = ThisDoc.Document.FullFileName
'define backslash as the split character
Dim Split As String() = oPath.Split("\")
'get the 5th item in the string array
Dim oJobName As String = Split(5)
'write to the Project iProperty
iProperties.Value("Project", "Project") = oJobName

'get the name of the model from the drawing (looks at the first view of the drawing)
Try
oModelName = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName)
Catch
MessageBox.Show("Error: No Model Found", "iLogic")
Return 'exit the rule
End Try
'set the model project iprop
iProperties.Value(oModelName, "Project", "Project") = oJobName

 

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

Post to forums  

Autodesk Design & Make Report