Description
Key Learnings
- Learn what scripting can and can not be used for
- Discover basic scripting syntax and language
- Learn how to create simple scripts for use with Fabrication CADmep, Fabrication ESTmep, and Fabrication CAMduct
- Learn how to use scripts for modifying Fabrication properties
Speaker
DARREN YOUNG: All right, I'm-- well, you can see it up there. I'm Darren. I do a lot of stuff with fabrication software. I'm up in the Seattle area. If you kind of get lost, have questions that we can't answer during the lab, don't worry about it.
I tend to go quick and not worry about people falling behind, rather than not give some people enough information because I'm going too slow, because you can always email me anytime after. Just tell me, hey, I was in your class-- could be five years from now. Hey, I've got a question on this, email me.
We've got both work and personal. Sometimes I'm slow responding on the personal because I don't like touching a computer when I get home. But I've found that some companies don't like-- their companies don't like them to email another possibly competitor. So you've got my personal email address as well so that your boss doesn't see you're talking to the competition. But I know a lot of our competition, we share ideas. We're not sharing company secrets, it's just software stuff.
Yuck, picture, I hate that. They asked that we put them on there that year. I'm going to give you a little disclaimer, and it may-- I don't know, it may rattle some people. Some people come to labs and they like a nice step one, do this, step two, do this I don't do any of that. So if you've already downloaded my handout online, there's no steps to follow. It's kind of reference information.
Now, the reason I don't like to do that is because when you get back to your office, nothing is scripted. It's probably not going to work the same in your environment. You're going to run into problems. I like running into problems in my lab. I tried this a year or two ago and it seemed to work pretty well.
Let's run into a brick wall. Let's look at the problem. I'll try to explain what I see and what I'm thinking, and then what I'm going to do to work around that. That's what you're going to have to do when you get back to your office. So for that reason, I don't have a nice step by step, you know, do this.
I don't want to teach you how to follow steps. That doesn't really teach you anything. I want you to think through problems and understand maybe how I'm looking at the problem and to work around it. So like I said, if you're used to the step by steps you might be a little disappointed, but give it a try. Like I said, I'm always available for email. I get email as well.
So there's a number of people I know that, we stay in touch throughout the year. They'll throw problems my way and maybe I've run into it, maybe I haven't. I'll try to help them through it. How many people here have done COD scripting in one of the fabrication products-- CADmep, ESTmep, CAMduct? One, two, three, four-- few of you.
So, this is a 101 class. Those that have done COD scripting before may not learn anything. Actually you'll probably get some good stuff in the reference information. But this is, if you've never coded anything before you'll be able to do some really simple stuff with what I'm showing you. But we'll walk through it.
I'll kind of explain. We might be a little bit slow getting up to actually typing on the keyboard but you can follow along as well. So, the class material-- if you've not taken a lab before I'll show you where it is. If you have, you probably know. And that's not it. This PDI thing.
AUDIENCE: [INAUDIBLE]
DARREN YOUNG: This guy?
AUDIENCE: No, go back to the desktop.
DARREN YOUNG: All right, we'll close out of my awesome PowerPoint. All right, so on your desktop-- and I can't see anything worth a hoot. There is a Datasets folder. There's a scripting 101 lab and I've also got the Word document out there, as well as the PDF. I would recommend the Word document because then you don't have to type.
If you like to type, open the PDF. If you want to type, open a Word document. We can copy and paste a lot of what we're doing. So this is the handout we're going to go through. And I'll just explain some of it as we go through here.
Oh, by the way, in the back we've got some lab assistance. Ray Steve Garcia is on the right-- well, not the right right, but the left of the right guy. He's with THACO up in San Francisco Bay Area. To the very right we've got David Ronson with Applied Software, Evolved Mechanical. I've known those guys for years.
On the very left we've got Wade Wiesels from Modern Piping out of Des Moines?
AUDIENCE: Cedar Rapids.
DARREN YOUNG: Cedar Rapids, that's close. If at any point things aren't working right or you're falling behind, raise your hand. They'll come over. They'll realize that I've steered you in the wrong path and then they'll correct me and we'll get you up and going.
So, first of all, where do you find information on scripting? I don't see it in the non-English versions of the installed products, but the English version, I do. They have a Help file. And so we're just going to go through Program Files. Oh, I'll look over here, it's easier.
So, under Program Files we can go to Autodesk. We can find the fabrication products. 2019 is the only one installed. If you go under CADmep, ENUS, you've got the scripting help file here. This has a lot of information on scripting. They just released 2019.1 update.
They actually did update that help file with some of the things that they added in there in this next release. Normally they don't do a lot with scripting, but I've submitted a few bugs and they put a few things in there. All right, so I just go to Program Files under the C drive.
AUDIENCE: [INAUDIBLE].
DARREN YOUNG: Autodesk, or you know, Program Files, Autodesk, Fabrication, 2019, CADmep, ENUS. Now, I believe it's under the ESTmep and CAMduct as well if you're not using CADmep. But if you're using a non-US English language version, I don't know that you're going to get the Help file. Didn't look like it when I browse through the install media.
And again in the handout-- I don't want that. In the handout-- they told me they fixed the Alt Tab issue on these systems. That threw me for a loop last year. So you can come through and look at the different name spaces and things like that in here.
I don't find this-- I kind of find it helpful, but it's also misleading in a lot of ways, how to call the function. It's written by programmers, or software that programmers use, so it's not very user friendly. So I think my handout will be easier. But again, this is the path you would look for to find that if you wanted to do that back at your thing.
There's also a lot of online information on the web. I didn't give you the full path because it's this big long weird character thing so I made a little thing. But if you go to Autodesk's Knowledge Network, they've got a lot of stuff and some samples and things like that. Consume as much of that as you can as you're going through and trying to teach yourself more of this stuff. Here, let me-- before I forget, let me set my timer so I don't run over or short. There we go. So you'll see that in the handout.
Here are some rules of thumb. It's just plain text. There's nothing really compiled on here when you write the scripts. It's just ASCII text. Use Windows Notepad. That's all you need to do. If you do it in Microsoft Word, might be an issue.
There is a script editor in Fabrication, but it can be buggy when you run scripts. David, do you know if you can call the script editor up AcademyPE by itself or is it only when a script crashes that it comes up?
AUDIENCE: [INAUDIBLE]
DARREN YOUNG: There you go. So, in most development environments when your code crashes it stops, tells you where the issue is, you can fix it and click the little Continue button and it'll run on. You can stop and restart it and edit and save it in there. I've found where I've been chasing, fixing my bugs and it should work and it just doesn't, I close out of the editor and then just run my script and it works. So I recommend not using the editor.
If your script crashes, and it will when you're writing them, just close out of it, edit it back in Notepad-- in fact, I leave Notepad open. I just edit it, save it, but leave it open so I can go back and forth and test it. File extension, you do have to go through in your Notepad and change it to the asterisk dot asterisk, otherwise it throws a txt on it and then you have to type a .cod extension.
Let's see-- text strings, a piece of text as opposed to a numbers, double quotes. When people email me questions, sometimes I'll just type stuff on the fly hoping I get it right. Then they copy and paste it into the Notepad and it doesn't work. Pay attention to this. Notice how the double quotes are different. If you type that in like Microsoft Word or Outlook, you get directional double quotes.
If I type double quotes in Notepad, I get this. This is what the COD scripts are looking for. But I can paste that into Notepad and I do get the directional ones. I have spent hours troubleshooting scripts because of that. Again, one of those things.
It's just, it's frustrating, it should work, it just doesn't. It's the same thing this guy sent me and it worked for him, why is it not-- you know, I'm stupid, it doesn't work. It's something like that.
So, in ASCII text there's different character codes. What if I wanted to type a piece of text that had a double quote in it? How does it know I'm not just ending the piece of text? Like, in a CSV file from Excel, you'll see a lot of times the text has got double quotes around it. What if I want like the inch mark?
So there's ways you can specify the character code and add that onto the string. And that's how you embed stuff like that. You can embedded code for a carriage return or a tab. So when I've got a dialog that provides me information I can put that little code in there and all of the sudden it starts a new line even though I'm giving it one piece of text. Or I can give it two pieces of information and tab one of them over by embedding that code.
So these are just some 101 rules I'm going over to kind of get you started. Variables have a DIM statement, a function, that dimensions the variable and allocates space for the variable. We'll see some of that when we get into that in the code. Variable names must begin with an alpha character, no spaces or goofy characters. Maybe some goofy characters work, but again it's best to stay away from a lot of that stuff.
You can't begin a variable with a number but you could have a variable begins with text and then have a number later in it. What else we got here? Not case sensitive. So it doesn't matter if you type uppercase, lowercase. I'm pretty particular. I try to make everything the same.
A lot of editors will actually force that on you but this doesn't care. So if you're bad at hitting the Shift key or Caps Lock, don't worry about it. The other thing, what do we do with scripts? They read and write properties. That's all they do.
I can't create a service. I can't draw a piece of pipe. I can't delete a piece of pipe. If you want to delete a piece of pipe, it'll call a list for some of the other APIs, delete it manually. The scripts only change properties of content, ITM content.
They can change it in your drawing. They can also change it in the library folder on your disk, and that's a little bit more work to get to do. So keep in mind when you're looking, here, I want to make this fancy program that does this-- get an idea of what scripts can and can't do for you. And so I guess, keep that mind. They only read and write properties.
A lot of programming has a concept of an object when we write the code. A door has a size, a height and a width and a thickness and a lockset, and the offset for the lockset, and a swing, and-- you know, same thing. Your content has properties-- materials, service, things like that. There is an item object in the scripting language. And again, when we get into this you'll see what I'm talking about.
That's how we access everything through the content we're going to try to modify. I did lie earlier. You can read and write to Job Properties. Anyone use Job-- well, let me step back a bit. How many people do not use any of the fabrication products, CADmep, ESTmep, or CAMduct? Is there anyone who's not a user of those? OK.
I don't know you're going to have a lot of use for this. Maybe you want to get into it. Maybe that's why. Even if you're using Revit and fabrication parts, you still need CADmep, ESTmep, or CAMduct to manage your database currently. There's plans on changing that down the road, but these scripts will help for that.
But there is this concept of Job Info, and you can type the job name and number and those things show up in your reports. There's a job object that gets you access in the scripting language to that information. So I can read or write the job information. Let's see, let's use the advanced processing for tasks.
Yeah, so if I select five different objects in CADmep and run the script, it's going to run the script five times, once on each object. That's just what it does. I don't need to worry about looping through stuff. I could actually select lines and arcs and things that have nothing to do with CADmep and it'll automatically filter all that stuff out.
So keep in mind, when you write a script it's going to run on everything you have selected. There are ways to get it to actually loop through a selection set so it runs the script as a whole on something. So maybe I'm going to read and put everything into one CSV file, all the properties of my content. And I've got scripts that do that that are part of the class material that you can have. That would be a way you would do that.
But that's a little bit above and beyond this. Nonetheless, it's documented in the reference information I'm providing. All right, so any questions up until this point? Like I said, just some basic rules. I'm sure I've forgotten a lot. You'll probably see that when I run into them here.
Couple ways to call a script in CADmep. I can type, execute script. There's also, I can call it from LISP. So, anybody an AutoLISP programmer? A few people? If you do AutoLISP programming you can call COD scripts from LISP.
So if you want to deal with some stuff in CADmep but you're doing other automation on the LISP side, you can call them. From ESTmep or CAMduct, you can highlight the item in your item take off. Right click and you'll see there's a little execute script thing there. I believe you can get to it through the File menu as well.
All right, so let's-- again, you're not typing a whole lot yet. I promise we'll get there. Item objects, like I said, there's an object called an item. And those are all the properties of your CADmep items. These are all of the properties that I've found that you can extract out. Some are documented in that help file.
A lot of the ones that you see highlighted in red are not. They're undocumented. I haven't found any documentation anywhere else. Maybe I found it in a LISP routine somewhere. Maybe I took a note off Extracad.com. Anyone use extracad.com? Best website possible for the information.
Some of it is because in the old exes, if you knew what some of the script function names were you can search in a hex editor and find it in the code with all these other garbled up characters. And then you'd see other one-- hey, I wonder what that does. Hey, that makes sense. Some of them are trial and error. And that's how I found some of the undocumented stuff.
But connectors, button codes, does your duct fitting have air turns? Is the value locked? What is the value? The connector, alternate connectors, what connector group is it in?
All of this information, if you're using ownership and versioning on your content, that information is accessible. All the dimension properties are accessible. You can see a whole wealth of information that you can get from an item.
This one in green's a little bit different. Does anyone know-- who doesn't know what a CID is in fabrication? So it's like a-- we talk about that like it's this thing. It's actually a user editable field, which I would recommend never editing unless you have a very, very good reason to do so. But the concept of CADmep, there's all these patterns. Pattern 868 is what? Straight pipe, I believe.
David knows if I'm wrong. I don't memorize the numbers as well as other people. Here's-- what's that?
AUDIENCE: 2041 is straight pipe.
DARREN YOUNG: 2041 is straight pipe? What's 868? Is that straight duct?
AUDIENCE: Hanger.
DARREN YOUNG: Hanger? That's the old hanger though, isn't it? Anyway, each of these different patterns have different parameters. CID is how we access some of that stuff traditionally. You'll see in the green on there, they now have pattern number. Typically they're the same. But you can edit the CID.
So if you ever go to ExtraCAD's website, or I actually have a website where I've got the information too, not every pattern is supported as fabrication parts in Revit. In the past I've had used the CID to look at that. But if somebody edited it, I don't know whether that CID is supported or not. They could have typed in an invalid number.
Since 2019.1, pattern number is now available in COD scripting. So if you install the update for 2019.1 you'll see that on there. You can get to product list information, for product listed pieces of pipe and elbows and adapters, sealant. I tell you whether it's read/write or read only. I think there's one property that you can write to but you can't read.
All right, and now there's also functions that actually do other things. I can extract out the end information. I can add a custom data field, set flow. A lot of this is, you know-- I talked about how we could actually, instead of modifying content in our drawing we could modify content in our library folder structure. That's the command you would use to remap the item object to that stuff.
So this is kind of boring at first. I just want to go over this reference information because we'll use this as we get going. Java objects, you type Job Info, these are the different fields you can get. This syntax is a lot more clean than what I've found in the help file. Most of this stuff, except where I have it in italics and says name or index, if it's in bold I should be able to copy and paste that right into Notepad and it's going to work, provided I'm using it in the right context.
So that's why I put this together. I don't have to necessarily try to-- they said one thing in the help file but I don't type it the same way. It's a little bit different. There is a job function where I can set the status of the job. Global miscellaneous functions, there's a debug dimension for the variables, like I told you before. There's an input box-- I can prompt the user for information.
Query, I can do a yes/no type dialog box. Never use that. Typical math-- plus, minus, multiplication, subtraction, and, or, not, logic. I want something that's green and a circle. Well, CADmep, maybe it's chilled water supply service and it's a piece of straight pipe.
Other math functions you can use. Again, I don't mean to get into that stuff too in-depth. String functions-- I could actually read files and write files to disk, so I could write all my information to a file or read it in and maybe populate it in my model. If you're used to programming you're used to some of this stuff.
Whole lot of different ways to loop. The essential functions for looping are in bold. So, I'm going to fall off of here at some point, I know it. And you guys can laugh. The Do, and then loop-- that's part of the looping. But I've got to set up a little counter variable. I've got a debug statement that tells me every time it loops what that is.
So what's in bold is kind of what's needed for the loop. Everything else is you managing that process within that looping function. There is a do while, a for next, for next step, so I can do every two and increment through a number value, if statements-- if this, do that. If this do one thing, else do something else.
Like I said, I've tried to document as much of this stuff. And a lot of it we'll not get into here. Select case-- if I've got a lot of different conditions, instead of doing if else, else if, else if, else if, I can do this select case. You'll see this quite a bit in scripts that deal with the different patterns. If it's an 868 pattern, if it's a 2041 pattern, and they'll use the CID number. Now we can use the pattern number for that stuff.
Anyway, I think that's the end of my just quick overview of the handout. Who wants to start typing some code? Anyone? All right, a few people. Most of you just want to sit there and listen to me be boring.
All right, come on. We can talk. It's all right. So, let's do this. Let's see where they buried this.
CADmep, no. AutoCAD, no. Anyone else been in the lab and know how to start? Where are the programs on this thing? I probably need to go to the desktop.
AUDIENCE: It's under Software.
DARREN YOUNG: Software? All right. All right. Fabrication CADmep 2019-- you guys all see that? Let's launch that guy. Don't worry, that says Advance Steel. That must be the last version of AutoCAD vertical they were running.
For this session we're just going to pick that default imperial content up at the top. That's all we're going to do. I've never seen that before. Nice. Yeah, we're in the United States.
Actually, you know what? We've got a lot of Advanced Steel stuff in here. Let's close out of this and just start playing AutoCAD. And then we'll launch CADmep instead. I don't want to have any of that vertical stuff getting in the way.
So, AutoCAD 2019 English, let's do that one. If anyone has any trouble launching this stuff, raise your hand and one of our lab assistants will help you out. You get AutoCAD open. You can do New File. I'm going to accept the default template.
And now we can type take off and hopefully it works. Nope, appload, then-- A-P-P-L-O-A-D. Has everyone used this before? We're going to back out one folder and scroll down. Then we're going to look for Fabrication 2019.
Is everyone seeing that? We're going to go into CADmep. And there's an ARX file in there. We're going to load that. Did I not hit Load? I picked that file-- load, here we go. Now this is coming up.
And I can close out of my Appload dialog box. So when you type appload it's going to default to the AutoCAD folder. Back out one level and scroll down and find Fabrication 2019. Probably a little hard to see, but that's the path we're looking at. I had a hard time in another lab seeing that stuff from the audience.
So who has not got CADmep loaded? Anybody? Few people? We'll get to you shortly. Take a little while, but once we get there it'll be easier.
AUDIENCE: [INAUDIBLE]
DARREN YOUNG: Pardon?
AUDIENCE: [INAUDIBLE]
DARREN YOUNG: Yes. For what we're going to do it's really not going to matter which configuration we're using. He asked if we're using the imperial content on top. That's what I'm using. It'd probably be easier to all use the same.
Now that we did an app load, if you started AutoCAD again you could type the word and take off and it would launch CADmep. It's gotta be registered for each vertical. They should have made the installer smarter but they haven't. While they're working around on that, let me go through some other-- I'll just show you some other stuff I've got out here in the class material.
But under the class material you'll see you'll got a scripts folder, debug, job items, library items. These are a bunch of scripts that I use doing my job. When I use the debug one a lot, when I'm trying to write code-- and well, do they want the group name as well as the connector name, or is it just the connector name? I've got a debug script that says connectors and I click on an existing item and it shows me the information so I see what, to type that.
But play around with the scripts when you're back at your office. The job items, you can pick which properties you're looking for and it'll actually export all the properties for all the items in your job into a CSV file in the root of your Items folder of your database. The library item, scripts, those do the same thing but it extracts information from all the ITMs in your library folder structure. We're not going to get into them there, but they're handy to look at.
Again, when I write scripts I'll look and see what other scripts are using that type of calls to see how to format it. So, anyone not have AutoCAD and CADmep loaded? Licensing error.
AUDIENCE: Is everybody getting a licensing error?
AUDIENCE: [INAUDIBLE]
DARREN YOUNG: We can go back and run that CADmep inside of AutoCAD and doing it this way, but it loaded Advanced Steel if that gets you through.
AUDIENCE: So multi-user.
DARREN YOUNG: Multi-user?
AUDIENCE: Yeah.
DARREN YOUNG: So, who-- anyone not running CADmep yet? Everyone's good? In my lab sometime-- who's not running it? Who is running it? And nobody raises their hands to either way. A lot of times it's like, so, nobody's there and nobody's behind there-- somewhere.
All right, so we're going to move ahead. Let's just drop in a piece of straight duct. Ah, there's my licensing thing, multi-user. And are those even realistic dimensions? Yeah, they're not too bad.
So now I've got a piece of straight duct drawn, right? So, what do we want to know about that? What if we wanted our script to tell us what item number it is? What's the work to doing that?
Let's see here. That's not it. Let's just work in our datasets folder. It might make it a little bit easier. Scripting 101, we'll just make a folder in there.
I'm going to right click and I'm going to say New. I'm going to look at the other screen, it's bigger. And we're going to say text document. And I'm going to change that file name to test.cod.
Don't worry about the extension change. It's just, it thinks I want to make a text document but I change the file extension, right? So it says COD now. We've got an empty text file. We can right click on that, Open With-- so again, right click, Open With, more options. And I'm going to pick Notepad.
AUDIENCE: [INAUDIBLE]
DARREN YOUNG: Pardon?
AUDIENCE: [INAUDIBLE]
DARREN YOUNG: Oh, is it? We're going to stick with Notepad. So there's now my file open in Windows Notepad, right? Is everyone here? You don't need to do this, but I'm going to do it because it's hard to see. I'm going to change my font size. You could literally create it anywhere, but they're using these VDI systems and there might be another C drive somewhere that the VDI isn't seeing.
So again, right click in the empty area, New, text document. Is everyone there? Almost? All right, so we'll just arbitrarily pick something. I want to see what item number that piece of duct is. So to start with, let's go back to AutoCAD.
If I double click this, that's a small pink box. And I go to this Items tab. Here's my item number. Change it if you want to. If you don't believe the script is doing what you think it's doing, change it to something so you're sure.
So now I've got that. Let's go back to my documentation. And here's a debug function. What debug does is, it's kind of like an alert box. So we're going to use that to display the information. Remember I said item is the object that we're looking for.
We're going to come back through, and again the stuff should be alphabetical, item number. That's how I get to the number information. So from Notepad, I'm going to type debug. Is that large enough, or should I make that font a little bit bigger? That's good?
AUDIENCE: Yeah.
DARREN YOUNG: So debug, that's the function we're going to use in the scripting language. And like I said before, if you don't want to type. I can literally come down here, highlight it, Control-C, Control-V. It must not be work-- there we go, Control-V. Debug item number, and then we're going to save it.
Stop using Alt Tab. Is everyone here? Anyone not here? This is pretty simple, right? So now from CADmep, we're going to type execute script. There's an execute process, might show up there by default. Execute script is the one I want.
A little small to see there, but type that. And that's going to default you to the scripts folder of your database, which is where I usually keep my scripts so that they're right there. But for the purpose of this class, we're going to come back and we're going to go to the datasets, CADmep scripting. You'll see our test COD script there, right?
And I'm going to run that and it's going to ask me to select objects. And there's the information on my item number. You're all now coders. Pretty simple, right? You don't have to get super advanced. Everyone starts out at some point.
But just a simple script, and now I just told it to display the item number. Which in itself isn't very much useful. But you get a lot of these properties we're looking at, what type of information is it really returning? I use debug for this stuff.
If we arrow up, we can get the Execute Script command again. We're going to go through and I'll show you what some of the scripts that I have. I'm going to order datasets again. If you remember I've got these debug scripts. I want to debug item number.
You see I've got a little bit more fancy formatting in there. But I've got a script that does that for me already. And so I would encourage you to use those. And you can see how I'm calling the function. So, what should we do next?
We want to change the item number? Who wants to do that? So we're going to go back to Notepad. I still have it open. I should've told you, you don't need to close out of it. Keep it open.
If you're not, if it's not open, you can open it back up again. We're going to keep this line. Extra spaces and things like that don't really matter in here. We're going to keep that line because I want to verify that it did what I'm telling it to do. So how do we change item number?
I'm going to highlight that, copy it, paste it up here. Really dangerous here. And I'm going to ask somebody to throw out a number for me.
[INTERPOSING VOICES]
I can't-- too many people talking at once so I don't know.
AUDIENCE: 300.
DARREN YOUNG: 300, there you go. Item number equals 300. I don't like-- I think this will work. The reason I don't know is because I always type it this way. It's just habit. It's good when you write code to kind of stick to a regiment of, you know, so that when you're debugging things it's predictable and you don't take your own errors in there.
So I'm going to save this. Actually, you know what? Before we do that, let's copy this before. I'm going to display the item number in a dialogue. I'm going to change it, and I'm got to display it again. We'll see if it does what we think we're doing.
So, is everyone here? Again, arrow up, execute script, we'll recall the last list of commands. If you type something else you can do it a few times and get there. Again, we're going to go over to datasets, scripting. And I'm going to run that script again.
I'm going to select my item. My item number was 123 when I started. If I click OK it's going to continue to run that script and change it. And then it's going to display the item number again. I'm reading it from the item. Now it says 300.
So I'm just going to come in and double click on the item again and take a look-- item number 300. We just modified a property of something in fabrication products. This script will work and ESTmep, it will work in CAMduct. It doesn't care. It doesn't need to be CADmep.
That's one nice thing about the COD scripting language. It works across all three of those products even though two of them aren't based on AutoCAD. So, I don't really care about the message. I just want a script to plow through stuff, right? There is also another command, REM-- again, not case sensitive. Stands for Remark, or Comment.
We can highlight that line out. You don't have to type all that. But it's good to put notes in your code so you can see what you're doing. But you see, I also commented out the code with the debug line, right? So, a lot of times when people send me scripting things that don't work, they don't know what's going on.
I don't know what's going on when mine break. I'll put a bunch of debug statements in there-- before loop, in loop, after loop, before change, after change. And it's annoying, especially remember I said that script gets run and everything's selected? So don't test it out by windowing a whole building or you're going to be clicking OK till you want to-- you'll probably just Control-Alt-Delete, honestly.
But I'll test on one item a couple items. And I'll see those debug messages, and it kind of gives me an idea where in my code things are going wrong. So right now I just want it to be item 300. So I commented them out. A lot of times I'll leave them in there so when I go back to change it later, I uncomment them out and I can get back into debug mode in my mind if I want to see that.
But let's go back to AutoCAD and run that again. Where did this come from? Execute script, datasets-- I really should have just put it in the other spot. But we'll keep running with it. Now there's no prompt.
We know our code works, right? So let's drop in a couple more fittings. I'll show you how much of a sheet metal worker I am. We're going to build some ductwork that's real functional. As you draw on CADmep, or [INAUDIBLE] Cam item number two, item number three. Now the last one, that should be item number five.
It continued on with its automatic numbering. Even though I renumbered the one, it knows its next numbers is two. So let's run our script on all of those. Just so you know, you don't have to do elbows. You can drop in whatever you want.
Let's arrow up a couple of times till we get to Execute Script. Datasets, MEP, going to run this. I'm going to run-- just select everything. Doesn't look like anything happened, really. Real quick progress bar, but when I click that last item, item number 300, everything is item number 300 now.
Again, not very practical but we're not just showing you how to apply this to your job. We're showing you how the coding works. Automatically without any looping, I just processed every single piece of duct that I selected. I ran that script each time on each one of them. If you really don't believe me, let's just take out this last remark and put our debug back in there. And we're going to save that again.
I'm going to arrow up and execute. C drive, datasets-- I can't remember if I saved that or not. I think I did. There you go. That's telling me I changed it to 300. It's already 300, but it's setting it again to the same value.
And it's telling me again. If I drag this down, it tells me what script I'm running. It prompted me five times. So, I don't use those debugs a whole lot. Only when I'm troubleshooting stuff and then I select small bits of stuff. When you get more proficient, you may want to process a whole selection set of stuff at a time. That's beyond this class.
But just note, I want to do something to all these items. So, how do I do that? I don't need to build a fancy loop. It'll do it automatically. Works with a lot of your stuff.
Is everyone on track so far? What do you want to do next? How about changing the item number if it's straight duct but not an elbow? You guys want to do that? Or do you want to do something else, like connectors or-- straight ducts, all right.
So how do we know if it's straight duct or not? I do have access to the file name. But if I'm going to give my script to anybody else, they might not call their ITM straight duct. Could be straight. Could be whatever.
I don't know what it is. It's probably not a good measure to determine. The pattern numbers are a good way to figure that out, right? Yeah.
How many people here are using something newer than 2019 fabrication products? Nobody. Everyone's on 2019? Wow! You guys are further ahead than me.
I'll use the CID number just because it only works in 2019.1. And if you use the pattern number and it's earlier, it's going to fail.
So I'm going to look at the pattern number. And I can highlight that one right click and say Academy P properties. Again, I don't remember this stuff. There's people that do this more than I do who are better at it. I'm going to go to the General tab.
You see based on pattern 866, CID is actually an editable field. Remember I told you that? It should be the same. There are some very small situations that it makes sense to change that to trick things that don't work the way you need them to.
But in general, so we're going to look at the CID, which is essentially the pattern number. So our straight is 866. And we're going to highlight, right click, and go to Properties here. Oh, I've got two things selected, so it does that. I only want one.
I'm going to go to General. And that's pattern three. Do we want to change the duct or the elbows? Duct-- there's a straight duct. And I guess the elbows are duct too.
All right, so 866 is the CID we're looking for. Got about 40 minutes left. We can come to our reference here. How do I get to the CID? That's pretty simple, right?
That's going to probably tell me what the CID number is. Actually, if we want to test that, we can do Execute Script. And I'll show you, this is where I use my little debug scripts that I provided as part of the class. They come in handy. I know debug.
And I've got one called CID. And I just run it. There. And I don't have to do that right click Properties thing. So-- and then I can look at the debug script and see the exact syntax of how that's reading that information.
But we're going to go to here. And let's get rid of that note. We're going to make another debug. Actually, we'll get rid of this one.
And we're going to do another debug, but this time, the tab does not work. It's hard to break Alt Tab. I'm going to copy this. Control C, Control V. I just want to make sure again, I'm just-- I'm not trying to write the whole thing at once.
I'm doing it little by little. Save, go to Academy P, Execute Script. At this point, you shouldn't need to be following exactly along with me. You should kind of be able to see what I'm doing and go a little bit on your own. I'm going to pick this piece of duct.
I've got a couple debugs. One tells me the CID number. One tells me the item number I want to set it to. So that's good.
So now we know how to get the CID number. Now we need some type of statement to check. What CID is it? And we're only going to do this if it matches what we're looking for. Again, we can come down to our-- the reference information.
Again, could use the help file too. I think it's towards the end. Come on. Now again, what's involved is kind of what you need, but they've got some other things in there. I really don't-- I've got to check something.
It doesn't have to be that. But if, what I'm testing, and then I tell it what to do. Whatever is in between is what it's going to do. And then I end the if statement. So that's what I got to put in my code, right?
I can say if item. CID equals 866 then we're going to do item number. I like to indent it a little bit so I don't get lost. And we're going to change that to 1,000. Or we'll change it to 1,111 and if.
866, you're right. See, you guys are already better programmers than I am. Pretty basic stuff. So if it's pattern 866, it's going to change the number. And that's going to tell us what the number is. So save that. Arrow up.
And I'm going to select two things this time. Ooh, wrong data set. I'm going to select one elbow and the piece of straight duct. Item number 300, item number 1,111. It only changed it for the straight duct.
Anyone got any questions on that? Again, pretty simple stuff, right? You know, when you get into more complex statements where you're testing multiple conditions, you know-- I'll put a little debug yes in there. So now that I know it passed my condition, I'll see the yes pop up. And when it doesn't, I won't.
That's how I test some of stuff. So we're going to take the training wheels off, change this statement based on your documentation so that it changes the number to something else for the straight duct and yet a different thing if it's not straight duct. So how are we going to do that? We're going to look back at the help.
Remember, is if this is true, we're going to then do this. But there's also an else. If this is true do this, else do that, so there's the if else statement we're going to look at. So we'll give you a little bit to go through your code, your reference and look at that if statement. In fact, I'll call it up.
Here's kind of an if else structure. Take the code you already wrote and change it. So it changes the number, item number to one thing if it's the 866 and a number, number, another number if it's something else. So I'll give you guys a couple minutes to do that. Don't care what your numbers are, but it's essentially that we're just going to take that existing code and add an else.
We know it works if it's 866, but we want the else. So when it's the elbow, what do I do? If it's not an 866 what do I do? That's the if else.
AUDIENCE: [INAUDIBLE].
DARREN YOUNG: Pardon?
AUDIENCE: [INAUDIBLE]
DARREN YOUNG: You want Notepad up there? All right. There you go. So now you can see both of them.
AUDIENCE: [INAUDIBLE]
DARREN YOUNG: Yeah. So how do I indent that? Just Space bar. If I want sometimes too, and I've got a lot going on, I'll add extra lines between if statements or other things going on, and I'll put a bunch of remark statements and a bunch of asterisks. And hey, you know, this is what's happening in this section.
Those keyboards are pretty quiet, so-- As you can see this-- none of this stuff is really hard. What's hard is you're going to go back and you're going to want to do something way more advanced than this. But this is kind of how you start out.
A few must picks and clicks yet. How many people are done? Have you tested it? Did it work?
For those that aren't, just because we don't want to-- it's going to be pretty boring if you just sit here. And I've been in labs like that. Do this, I'll check back in 15 minutes. Oh my god. And it was a top rated speaker too.
I just don't know. Maybe I'm just not as friendly. That could be true. All right.
There, how long did that take? Not too long. Typing this stuff up from scratch is kind of a pain. By the way, anyone fly here on Southwest? Any of you are drinkers?
Drink on me. One more on this side. I'll do a couple on the side. Drink on me. Some of my flights are so short, I don't want to--
All right. I'll get you back here. They're just going to go to waste. Some of my flights are so short that by the time I opened it up they're landing again. There, I bought four people a drink.
So someone got something like this typed up and it worked? Pretty cool, huh? What do you want to do next, David? Select case? Or do we want to do like, connectors where it's a collection of stuff?
DAVID: Change the connector based on periphery.
DARREN YOUNG: Change a connector based on periphery? Oh, that might take a little bit longer because there's-- you got to start looking at dimensions. But again, so what David said is you know, let's change the connector based on the periphery of the depth. But-- well, exposed unexposed.
If you had a note that said exposed, you could look at the note and do that. If it was on a different service you could do that. Or you could just have them select the exposed duct. Or if it's on layers, you could select by layer outside the COD script.
So let's look at connectors. Something's a little bit different, right? How many item numbers on an item? One. You know, there's a lot of properties.
How many materials on an item? One. Actually, that's not true in some cases. But there's a lot of properties. There's one service that the item belongs to.
There's one number. But connectors, cap, one piece. Straight piece of pipe or duct, two connectors. I've got a T, three connectors. I got a cross, four connectors.
Some other goofy equipment's got multiple connectors. So they have this concept of collections. And those get little bit more tricky. We might get into some looping when we want to do that.
So let's just say we're going to skip or delete some of this stuff out. But we're going to still work on our straight duct. And if we look back on our documentation, let's head back up towards that near the top, connectors. This is key. This will tell you how many connectors.
And then these will dig into each connector based on the index of the connector. There's a connector one, two, three. So if you want to do something on all the connectors, you would actually have to loop through how many connectors?
I'm going to loop based on how many connectors, and do them all. But if I know hey, you know what? I just want the third connector on all of these or the first connector. So we'll do that.
You'll notice a few things here. Connector group is read. I can't write that. OK, that's a lie too. It's really complicated.
And I didn't write the code. I just borrowed it from somebody and modify it. There is ways to work around that. But you can. But in general, you can't change the group. So you're just giving a connector name.
So if the connect name is in a different group, it'll just jumped to that automatically. Where you run into problems as if you have the same connector name in multiple groups, it's probably just going to jump to the next one. But to start with, let's just edit our code so it looks at the connectors. Do we want stick with straight duct only, or do we want to get do the elbows too? Doesn't matter.
Actually, you know what? Let's do it on everything. I'm going to start all over. So you remember item connectors? That tells us how many.
Copy, paste. I just put a little debug in that. Again, I want to keep it kind of clean for you so it's not too confusing. And we're going to run our script again. And again, it doesn't matter what I pick.
There are two connectors on that. Standing S and drive is the connector on that. So now that I know how many connectors, I've got to tell it which one. Let's just do something easy. And we're just going to pump a number in there.
You know, we're going to do the connector one. We're going to change. So if I go into a fitting, before I do that I've got to figure out what connectors are there. Let's look at the flange. There's a flange out.
There's a TDC connector. So we're going to change it to that. So how do I get to the connector value? Item connector. The index is in parentheses and then value.
Copy. And I'm going to paste that in there. We want connector one, right? What do you think we're going to type here? Anyone want to spit it out?
Jump balling. Right. But equals-- do I do this or do I do that? Remember, text strings have to be enclosed in double quotes. We're going to remark that.
I'm going to remark that out for now. And I'm just going to change connector one to TDC. Execute my script, pick my piece of duct. And you'll notice now there's a flange on the one side for a TDC connector. And when I double click to edit that, it does not show TDC.
Why is that? Is it-- that's interesting, isn't it? You'll run into some of the stuff. Again, this is why I try not to script everything, because you're going to run into this stuff.
So usually, so there's a function called item update, and it forces-- when I change the connector, that fitting might actually get shorter or longer. It needs more metal to make that flange. The developments change on the Cam side. There is an item update function, as David just said. And again, that's probably down at the bottom somewhere. I'll try to find what page it is. Did I not document that?
Oh, it's item functions. There you go, item functions. There we go. I'd forgot the alphabet for a while. Item update, let's try that.
And we're going to copy that and paste that into our script. And again, this is 2019.1. There's no saying that there's not a bug in there. So that kind of forces the item to update and reevaluate all the developments or the flat patterns and all that for that type of stuff.
We're going to save that. And we're going to run it again. I'm thinking it's not going to work again this time. And I got an idea why. Oh, now I updated it went away.
Anyone wonder why? So as Josh had mentioned, sheet metal items are driven by specification. The specification tells it what the connectors are. I changed it. I telled it to update. It went back to what it was doing before.
So how do we keep it from doing that? Anyone want to take a stab to guess? I think I heard somebody say it. There is a lock. If it's unlocked, the spec is going to drive it.
How do I get to-- how do I lock a connector? Let's go back to the beginning here. We're going to come down to connectors. And there's a locked. So copy that.
Locked equals true. True false are kind of like some built in variables. You should be able to do 0 and 1. 0 is false. 1 is true. So now I'm going to change that connector and lock it.
And just because I am the way I am, do I need to do an update? I don't know. I'm going to take it out of there just to see. That's how you get good at this stuff. Try it out.
See what's going on. And actually, you know what we could do? Let's do a item debug. Item connector-- I'm going to debug the value instead of setting it. I just screwed stuff up, didn't I?
I can't type. You've at least determined that. Item connector one, save. Now let's run it. TDC-- so I changed it and I locked it.
And then I told it to tell me what it was. And I got that flange back. I'm going to double click my item. And now you'll see that. Piping, plumbing, whole different thing.
Your specification isn't driving the connector. They're typically locked to begin with. So if you're changing the connector on piping, I want to change it from plain end to pressed end or threaded or something. Again, a fitting is a fitting. It's bought.
You shouldn't be doing that on a fitting, but you might do it on straight pipe. I'm buying the same carbon steel pipe whether I'm butt welding it, grooving it. Maybe if it's a little smaller stuff, there's gas fitting, press fittings for carbon steel for gas systems. I could change the connector. And I typically don't need to worry about the locking then, because on the piping side the specification isn't driving it.
And now I've determined that I don't need to do an item update either. That's just extra code that's not needed. Anyone have any questions so far on that stuff? So what if we want to change all the connectors on all the items? What if I want to change connector three on a T, and somebody selected something that wasn't T?
I could filter it out by CID. But there might be a couple of CIDs that are Ts. And I might miss one. It takes a while to start learning some of this stuff. And again, you run into these problem.
I run into these problems. You know, it didn't do it. OK, let's back up. What went wrong? Fix it, move on.
Let's make a quick little loop. Let's see what we have for looping options. We're going to come down here. Look at that. That while loop looks like it'll work.
And it will show me a variable as well. So let me-- I'm going to try to scroll this so it's towards the bottom. And you'll see how I'm editing the code in there. Let's see. There we go.
So I want to loop based on how many connectors I have, right? If I want to do them all. So I need a variable to count for me as I'm going through. And I'm just going to call that variable loop. Remember, it needs to begin with alpha character.
We've got to dimension it. I'm going to dimension the loop variable. Now it's allocated memory space for it. And I can set it later on, loop equals something. Or I could just do this, item-- actually, I should stop typing.
I'm not good at it. Copy, paste. I'm going to set that variable to how many connectors there are, because I don't know what you're selecting. You could select the cap. You could select a piece of straight duct, a T, a cross.
It could have a multitude of connectors on it. So I already set the variable loop. Alternatively, you could do this. This is fine as well. Does that makes sense to everyone?
And so now that you know, I've got my loop variable and I'm setting it, now I need the while, just like I'm typing in my thing. Loop is less than or equal to what? What do they just run into? Well, less than or equal-- how many connectors? I want to loop as many times as they have connectors.
This maybe isn't the best way. Maybe don't want to make that-- so I'm not going to loop. I'm not going to make my loop that way. I'm going to copy this. And I want to keep looping as long as there's connectors.
And now I'm going to start the loop at one. It's going to loop one. And as long as that number is less than how many connectors I have, it's going to keep going. And what I like to do, as soon as I do a while, I just finish it right away. Done.
Now I know I'm kind of balanced in that. I start typing in the middle. Well, I know I need to keep adding to that loop as I go through them. So the first time it goes through, it's going to look at connector one.
Second time, it goes through connector two. Third time, if there is a third connector, goes to connector three, correct? So I need to keep incrementing that loop. And I can say loop equals loop plus one. Does everyone see what I'm doing on that loop now?
And I'm going to move these items up into my loop. And again, if you want to space things out a little bit, make it more readable, you can. But now I'm not looking at connector one. I'm looking at-- I could throw that variable in there. It's just a temporary name that references a value.
So the first time it goes through, its connector one. But then I change loop to-- what is loop? Loop is one. Add one to it. Now it's two.
It's going to go through. And long as it's less than or equal, how many connectors? I've got two connectors. Is two less than equal to two? Yes.
It's going to go through change into DC. So now it's going to change loop to three. Is there three connectors?
No. That's greater than the number of connectors. And I'm done with my loop.
AUDIENCE: [INAUDIBLE]?
DARREN YOUNG: Pardon?
AUDIENCE: [INAUDIBLE]?
DARREN YOUNG: Do I need to lock it before it changes value? You mean unlock? I remember, it seems like a number of years ago, you actually had to unlock change and relock. What I found, it doesn't? By default, when I'm drawing the stuff, it's not locked.
So I don't need to unlock it. If you run into a case where hey, it can't change it because it's locked, you could put an unlock in there beforehand and be safe. But what I found recently is even with like, piping where the connector's locked, the script-- I can't change it through the UI anymore and change it. But when I run the script, the script is able to do it anyway.
I don't remember that always being the case. I remember a day years back where you had to unlock, set, relock. That doesn't seem to be the case anymore. And these are the things you'll run into. But again, it doesn't hurt anything.
We could put an unlock in there. And we'd do that like this. I don't think it's needed, but are we hurting anything? No. And it's one of the things that eh, maybe the functionality comes back.
I can't change a locked connector again in 2020. This code will still work because it'll unlock change and relock. If I take that out, and that functionality magically comes in as a new feature, my code breaks. And those are the types of things I think about when I'm writing code quite often, what could break down the road? For now, I'm going to take that off.
I try to do as little as I have to. We're going to save this. And you know what? Let's do this. We'll just pop up a message box every time.
And we're going to do execute script. How we doing on time? About 10 minutes. And I'm going to select everything. Now this is again, with that debug in there, don't select your whole freaking driving unless it's small like this.
But not only will it run the debug for every item you select, it's going to run it for every connector. So if there's five connectors you're going to get it five times for that item. And you've got 10 items selected. You're going to be clicking OK 50 times. Again, a pretty small data set.
There's loop one, loop two, and I'm done with the loop. It's TDC we threw up there at the end. Now I'm going through on the next item, loop one, loop two for the connector. Again, this is one of the things that I do this all the time. Maybe I should have put the debug in there.
Maybe I should have took it outside the while statement. Maybe I should have selected less items. And now it doesn't matter if it's straight or not. All my connectors are now TDC.
Remember, we made a loop? There's three connectors on this guy. Let's throw a T in there and try it. See if our scripts still works. If I just coded in and said connector one, connector two, what's going to happen on the T?
It's going to miss that third connector. And even though the number of connectors changed, my loop still worked. Pretty simple, right? It's not too bad.
Now if I only wanted to work on elbows, I could go back to that original if statement, change this CID, and put that whole loop within that if function. Do you guys want to try that? Why don't you guys try that? I won't walk you through it. I'll just type it up on my end.
Let's restrict the connectors to just elbows. So go back. You know, you've got the template with that loop. You need an if statement. And we'll run through it.
We're running short on time. So this is probably the last thing we'll do. Or do we want to ask questions?
Maybe we do that. If you want to work on that, go ahead. I'll type it up quick at the end. Does anyone got any questions? Yes?
AUDIENCE: I have one specific question. Do you know where I can find the code that is relative to the selection filter inside the program?
DARREN YOUNG: You mean map filter?
AUDIENCE: No, selection.
DARREN YOUNG: Select filter. So Auto CAD's filter.
AUDIENCE: That's what's in it.
AUDIENCE: You're talking about select filter.
AUDIENCE: [INAUDIBLE] that is very specific. [INAUDIBLE]. So I'm just going to reference that code, pull up the original, see if I can [INAUDIBLE].
DARREN YOUNG: Select filter. I know how to do map filter.
AUDIENCE: [INAUDIBLE].
DARREN YOUNG: Is it? Yeah, and you know, like, map filter, things like, that you can't do from a COD script. You're just changing properties. Now you can pre-select.
So I could type map filter, select filter. Long as whatever is selected is what I want to work on, when I do execute script, it won't prompt me anymore. It just sees the existing selection set.
AUDIENCE: [INAUDIBLE].
DARREN YOUNG: Say that again?
AUDIENCE: You can do the magnifying glass on the T bar. If you just click it, there's a flyout for the select filter.
DARREN YOUNG: This guy?
AUDIENCE: Correct. And you can window things, and it will pull up a similar dialog box.
DARREN YOUNG: There we go. So I ran through that select filter. I've got three things selected. When I run execute script, it's going to work on those three selected items.
AUDIENCE: Right.
DARREN YOUNG: is that what you were looking to do, but you want to do it automated?
AUDIENCE: [INAUDIBLE].
DARREN YOUNG: Yeah, I mean, the thing you're doing with select filter, you should have access to most of that stuff in the scripting language. And you could build a rather complex if and-- you can nest if's inside of if's and keep working your way down. So you should be able to look at a lot of properties and do that.
It's just you got to do it with a lot of code. And like, I've found too, sometimes it's easier to leave the code simpler and manually select some of that stuff. You know, I could try to automate the whole thing, but it's easier sometimes to automate parts and then just call those parts when you need them. It really depends on the task.
AUDIENCE: You could call a map filter and then run the script again with your map filter selection within this.
AUDIENCE: See, in my case, or in my specific situation, trying to isolate systems, the [INAUDIBLE] the total quantity, the figure number, which the figure number can be editable.
DARREN YOUNG: Yeah, I mean, most all that stuff should be accessible in the COD scripting language. You just have to go harvest it all and build the complex set of logic to do it. And if it's like, a one time deal, maybe not. But you know, if it's something that hey, this is part of our process. We run through this every time we push stuff to the shop for fabrication, it may be worth it.
Maybe you write separate COD scripts that do very narrow things. And for a model list, you do some of that more advanced filtering if you can. And then you call which COD script you need. There are some properties you can pull in from list.
Not as much, but it can be done. Does anyone have any questions? Do you guys want to see me type up that if statement around that loop so it only works on elbows?
AUDIENCE: Might want to show him the script that you're giving them for free. You got all your updating and your job scripts and all that.
DARREN YOUNG: Yeah. Well, yeah. Good point.
Let me show you some of that stuff. I do provide probably up to 150 scripts now. Like I said, we've got these debug scripts. They're kind of based on property. And like I said, sometimes one of the problems we had is we wanted to know what the installation spec is on a hanger so that we knew what support spec to apply so that we could quantify thermal pipe shields.
Sounds like it's something easy, but the hangar is oversized based on the insulation. The rod size, based on the pipe size. But a thermal pipe shield needs to look at both. And we do that with support specs. But our support specs should know based on the insulation spec.
You edit a hangar, there's no insulation spec on it. I ran my debug script for installation, it carries over the insulation spec, even though the editor dialog box doesn't show it. That's why I use these debug scripts for it to help mine information. So there's all of these other things. I've got this job items.
So if I wanted to write out all of the dimensions and their values, or if I wanted to write out all the connector information for all the items in my drawing connectors, that would do it in a drawing. And it'll put in a CSV in your C drive. So let me show you that quick. So use these scripts as you want. Like I said, I find them helpful, especially when I'm managing my database.
I'm going to look through the connectors. And whatever I select in here, it just got done doing. So now we are going to-- I just need to get a prompt up here. I'm going to look for my database. The database is under the Users folder, Public, Document, Downloads.
I'm looking at the wrong screen. It's too small. Documents, Autodesk, Fabrication, Imperial Data Content, Items. So where the Items are, I just made this text file.
And I can bring this in Excel. It's really a CSV. I list the CID number, the item path. This is connect to one of three.
And here's the connector name or the connector group, connector name, what type of connector, and whether it's locked or not. So a lot of times, I'll delete a connector out. And it comes back, and I don't know where it came from. I'll warn that same script, but not the jobs, the ones from the library.
And then I'll look through them. Hey, what item has that connector stuck in it? I keep updating them. I do have a couple of others.
If you look in the scripts, this extracts the product list data for product listed items like piping items, whether it's locked content from the old Autodesk days or building data. This will still mine out all those dimensions for you, if you would want to and try to rebuild it yourself. This one does the same thing as running all of these.
So usually, I'm only interested in like, one type of property. But maybe I want to dump everything. I run that. And again, if I grab them out of this folder, it runs that on every ITM in my library folder structure. And if you guys don't know where that is-- APP info-- you can find where your database is stored by looking through these locations.
Here's where my items are stored. It's going to put those export files in that folder. But like I said, I use those quite a bit when I'm managing and trying to update a lot of content. I delete a connector.
But I draw and all of a sudden, the connector comes back. I thought I had deleted, changed everything, but there's a piece of content still using it. Like I said, I use the scripts a lot of times too. Hey, I need to do something with sealant. Actually, they just fixed Sealant in 2019.1, because not everything has Sealant.
And it would fail if you tried to access it and it didn't exist on a particular item. But I'll go through one of the scripts and dig through. Now the ones from the library and the job, there's a lot of looping and processing of folders. They're pretty complicated. But I'll look at the debug ones too.
And hey, how did I call that? How is it reading that information? So I just use them as examples.
Like I said, don't try to write from scratch all the time. Look back at stuff you've already written. I constantly am searching through my old code to find how I did things and just copy and paste and edit.
That's kind of it. I've got some business cards up here if you guys want to grab them. Somewhere, I've got my PowerPoint here. There we go. Contact info, email me whenever.
I'm not going to write a program for you. But I'll try to debug when I can and help you out and give you pointers. But don't, hey, I want a program that does this. Can you write it for me? I won't do that.
But like I said, I'll point out and give you my thoughts. Maybe it's not doable, but there's other ways around it. Do that for a lot of folks.
So that's all I've got. Thanks for coming. And hopefully this has been helpful.
[APPLAUSE]
Downloads
Tags
Product | |
Industries | |
Topics |