Does anyone know how I can pass a feature / dimension / measurement from PC-DMIS to a VB Script and access it's measured value / tolerances / deviation / etc in the script? I have been able to pass numeric and string parameters, but not geometric objects.
Passing Features to VB Script
Collapse
X
-
try this
Instead of passing features into a script, I use the script to find the feature and extract the data I need. Here is one example (assuming certain declarations are in place for the script). . .
For Each cmd In cmds
If cmd.IsFeature And cmd.ID = "PLN1" Then
MX = cmd.GetText(MEAS_X, 0)
MY = cmd.GetText(MEAS_Y, 0)
mz = cmd.GetText(MEAS_Z, 0)
MI = cmd.GetText(MEAS_I, 0)
MJ = cmd.GetText(MEAS_J, 0)
MK = cmd.GetText(MEAS_K, 0)
End If
Next cmd
-
Thanks,
I think that will get me by, but in general, I wish there were a better
way to pass a feature to a vbscript. It seems pretty inefficient to have
to loop through everything to find the one thing you already have a
handle on in the PC-DMIS code.
A little detective work convinced me that I can pass a feature as a
parameter to a vbscript, but it gets there as a 'Dispatch' object type,
and I do not know how to access it's properties. Not being a VB guru,
I'm not sure what to do with a 'Dispatch'. I'm probably digging a little
deeper than I should at this point, but like I say, passing a feature
to a script seems like it would be a handy thing to be able to do.
If you have any experience with a 'Dispatch' or run across a better way
to pass features, please let me know.
Thanks Again,
Dana
Comment
-
What exactly is your goal? If you are passing strings can you not use an assignment in PCDMIS to capture the feature data and pass that as a string? What are you passing to? Another app? An app you wrote? I pass info back and forth between PCDMIS and apps that I wrote in VB. I find that writting data to a text file and reading it in to be very flexable. When you hard code an app declare an array. Then all you have to do is read in from a text file to that array. I do it like this because I can modify how much info I pass without having to modify the declarations in my app. I'd like to know what you are doing exactly because I believe I stand to learn something here. What is your code for passing strings back and forth and what are you doing with it? I'm interested.<internet bumper sticker goes here>
Comment
Related Topics
Collapse
-
by DaSaloI want to write a script that will locate a group of constructed sets and write the point data from each out to an external file. I already have a robust...
-
Channel: PC-DMIS Code Samples
08-19-2014, 08:17 AM -
-
by jvwhyHi All,
I hope this makes sense.
Is there a way to pass a variable to a basic script when it is called from a PCDMIS program?...-
Channel: PC-DMIS Code Samples
09-09-2014, 12:21 PM -
-
by kaikaiI am new to PC-DMIS script. I am trying to read the script examples in the “Wizards” folder that comes with the installation. However, they are all...
-
Channel: PC-DMIS Code Samples
06-09-2017, 01:44 PM -
-
by MykelHi guys.
I'm in the need of your help - again.
The users (operators) of the programs tips in on which machine the parts have been produced....-
Channel: PC-DMIS for CMMs
10-04-2015, 04:58 PM -
-
I'm trying to pass a variable for work orde number from pc-dmis user input
C2 =COMMENT/INPUT,NO,FULL SCREEN=NO,
...-
Channel: PC-DMIS Code Samples
06-05-2018, 01:03 PM -
Comment