[Cl...] Posted October 18, 2019 Share Posted October 18, 2019 I'm "trying" to write a simple program for two part sizes. Having trouble getting the CAD model to load when I switch part numbers. Need help, at work, left notes & PCM manual at home. Link to comment Share on other sites More sharing options...
[Er...] Posted October 18, 2019 Share Posted October 18, 2019 Aint it loadCADFile? Link to comment Share on other sites More sharing options...
[Cl...] Posted October 18, 2019 Author Share Posted October 18, 2019 If you mean change the "f" to "F"? Then no, that didn't work. Link to comment Share on other sites More sharing options...
[Er...] Posted October 18, 2019 Share Posted October 18, 2019 Yes it will do the trick to load the cad model. But it wont fix your other issue. To selectCase you assing s1 or s2. But then you check for s1 or s3. Link to comment Share on other sites More sharing options...
[Cl...] Posted October 18, 2019 Author Share Posted October 18, 2019 Oop's, fat fingered it. Thanks! Link to comment Share on other sites More sharing options...
[Cl...] Posted October 18, 2019 Author Share Posted October 18, 2019 I fixed all that, but it still won't load??? Link to comment Share on other sites More sharing options...
[Er...] Posted October 18, 2019 Share Posted October 18, 2019 Try to write your cases like this: case is == "s1" I think that will do, cant check my self since I have cached the flu and is dying in my sofa. Link to comment Share on other sites More sharing options...
[Cl...] Posted October 18, 2019 Author Share Posted October 18, 2019 Thank you, hope your felling better soon. Link to comment Share on other sites More sharing options...
[Ke...] Posted October 18, 2019 Share Posted October 18, 2019 Clarke, A couple things: 1) The syntax is definitely with a capital "F" as in...loadCADFile. 2) I would remove the code you have in the "Parameter" window and place it into the "Presettings" of the program. In my experience, the "Parameter" window is for you to set parameters that you can then use throughout the program. I am not sure if this is the place to input commands such as load file. 3) You can place the variables and load CAD command for each part size directly into the case specific coding. For example, place the S1 variables and loadCAD command in separate lines directly underneath the: runPCMFile(dir + "\S1.txt") command Hope this does the trick for you. Keith Link to comment Share on other sites More sharing options...
[Cl...] Posted October 18, 2019 Author Share Posted October 18, 2019 Thanks, I'll give that a try. Link to comment Share on other sites More sharing options...
[De...] Posted October 18, 2019 Share Posted October 18, 2019 I could be wrong but it looks like you are attempting to assign the value to dir + whatever in the parameter input screen, but that is for manual input and the variable dir is never assigned. As was said, put this in the presettings code area. Link to comment Share on other sites More sharing options...
[Er...] Posted October 18, 2019 Share Posted October 18, 2019 If We really disect this, there are plenty opprtunities for improvement. clearCAD() part=inquireList("Choose","s1","s2") runPCMFile(getActualInspectionDir()+"\"+part+".txt") Thats all that you really need. The logic is simple enoght so there is no need to complicated things. Link to comment Share on other sites More sharing options...
[No...] Posted October 21, 2019 Share Posted October 21, 2019 Please sign in to view this quote. Yes, I think this is what the error message means: loadCADFile is a command, but the parameter window only supports variable assignments. So you could execute it if you'd write something like x=loadCADFile..., but that would probably still not solve the issue. My guess is that the parameter assignments are executed before any pre- or postsettings and therefore the variable dir doesn't contain any value (or doesn't even exist) when loadCADFile is called. Link to comment Share on other sites More sharing options...
[Cl...] Posted October 21, 2019 Author Share Posted October 21, 2019 FYI, all the PCM examples I have posted here are directly from a Zeiss written program. I'm using it as a guide. Link to comment Share on other sites More sharing options...
[Ro...] Posted October 23, 2019 Share Posted October 23, 2019 I have a customer supplied program for about 2 dozen part numbers, written by a guy much smarter than I. Ive actually learned a ton by digging into this program and reverse engineering parts into my own programs. This is the code he used to swap cad models clearCAD() loadCADFile(getActualInspectionDir()+"\"+PN+".sat") Note, the command getActualInspectionDir() will find your current program folder no matter where it is located, so when Calypso updates and all the programs are moved from Ziess\Calypso6.2 to Zeiss\Calypso6.6, the program isn't corrupted. The way that i have used this tool is i load a cad model into the program, transform and heal it where i want it, then use CAD>Cadfile>Save and save it into the program file as a sat file. then when you recall the cad model everything is in place perfectly. Funny story, this guy is a whiz at PCM, everything is parameterized in an excel sheet, much more than i ever thought was possible, but his programming of free form surfaces was entry level at best.... Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in