You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Now compiled with Creo Parametric 9.0 libs and Tcl 8.6 (no more deprecated Creo Calls in use)
More Info on the Tcl's Wiki and/or Youtube
#Dirty parameter sample, foreach model in session set the parameter MyParam as a String with the value „Hello Tcl“
# This may fail on lock or parameter is not a string
foreach Model [ps::glob *.prt] {
ps::param set -model $Model — MyParam String „Hello Tcl“
}
# Same Task but More Checks
# Get all part files in session and loop through
foreach Model [ps::glob *.prt] {
# Check if already exists
if { [ ps::param exists -model $Model — MyParam ] } {
# Get the Parameter Handle
set paramObj [ps::param list -model $Model — MyParam]
# If the parameter is a string, else do nothing
if {[string equal [$paramObj get -type] STRING]} {
# Set if we have a different value only
if {[string compare [$paramObj cget -value] „Hello Tcl“]} {
# This may fail on lock (Relation usage), but this can be checked as well
$paramObj config -value „Hello Tcl“
}
}
} else {
# Just set the parameter in Creo
ps::param set -model $Model — MyParam String „Hello Tcl“