Hi, I'm having some trouble adding my current project to the i properties, I often get stp from customers. files supplied, the i properties block is completely empty. I always create a project and would like to see the project number I am working in in my i properties, is something automatically possible? I already looked at i logic, but I didn't see anything about the current project or the like.
thanks in advance!
Ties v. Heugten
Solved! Go to Solution.
Solved by jtylerbc. Go to Solution.
Just to clarify, are you wanting to have your project file name automatically be applied to the project iproperty upon importing a step file?
Yes, that's possible. I have a rule that does that. This puts the project file's name (without the .ipj extension) into the "Project" iProperty of a drawing. I don't think anything would need to change for it to work in an assembly or part file, but it has never been tested that way.
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
As I mentioned in my previous message, I've never used it in a part file before. But I just tried it, and it worked fine for me, with no changes to the code. Not sure why it would behave differently for you.
worked for me on both ipt and iam.. I just pasted the code into an empty file of each and all was fine.
hi,
my bad, i tested it again on other files and it worked perfect thanks!
i closed the parts where i tested it on first and when i reopend it it worked fine
Forgot to mention this earlier, but you'll want to set an Event Trigger for that rule.
The way I typically use it is with just the "New Document" trigger. That's because sometimes our project file names are rather long, or there may be multiple "sub-projects" where we want that field on the drawing worded slightly differently, but are working under the same project file. For those reasons, we only want this rule to be triggered at initial file creation, and after that the user can edit the "Project" property manually without the rule overwriting the edits.
If your project file names are a bit more consistent, you may want to use something like "Before Save" instead, so it will check the project file name every time.
Can't find what you're looking for? Ask the community or share your knowledge.