Jump to content

New to PCM


---
 Share

Recommended Posts

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.
150_1f78d664bdf9619cc92863dff10f4d02.png
150_edb317a9aa79684b43dd1b366e35b566.png
150_ec8b7089e0c24836b0457dd78d3a5ab6.png
Link to comment
Share on other sites

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

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

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

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

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

 Share

×
×
  • Create New...