Skip to main content
Oct 15, 2024 7:53 AM UTC
Question

Assistance Needed with Automating Dimension Report in Creo TOOLKIT

Dear Sirs,

I hope this message finds you well.

I am reaching out regarding the Creo drawing inspection function shown in the attached image. This function automatically generates a dimension report and allows for the export of dimension data to an Excel file via the "Export to XLS" button.

I am looking to automate this process using Creo TOOLKIT, specifically to automatically extract dimensions and generate the report. However, I am not very experienced with programming.

I would greatly appreciate any guidance, tips, or code examples on how to achieve this. Thank you in advance for your assistance!

 

Best regards,
Lan Haydena

Catalina_0-1728981126905.png

 

4 replies

Community Manager
Oct 18, 2024 10:13 AM UTC

Hi @Haydena 


Thank you for your question!

Your post appears well documented but has not yet received any response. I am replying to raise awareness. Hopefully, another community member will be able to help.

Also, feel free to add any additional information you think might be relevant. 

 

Best regards,

Oct 23, 2024 12:36 PM UTC

There is not a lot of feedback here. For what it worth, to give you a clue how this could work!

#
# export only a dimension value from type diameter
# add tolernce values and inspection basic info

# sample out (of course out is without the '#')
# Symbol,Value,TolL,TolH,Inspection,Basic
# d2,32.000,0.005334,0.005334,No,No
# d12,5.334,0.005334,0.005334,No,No
# d27,10.667,0.005334,0.005334,No,No

proc SimpleByType {model {sep {,}}} {

	set B(0) No
	set B(1) Yes
	set dims [ps_dim list -model $model]

	set out [file join [ps_pwd] dim-info-by-type--$model.csv]

	set fp [open $out w]


	puts $fp "Symbol,Value,TolL,TolH,Inspection,Basic"

	foreach item $dims {

		# assign id sym val to a var from the list item
		foreach {id sym val} $item break

		# get the dim Object handle
		set dimObj [ps_dim from_ids $id]

		if {[string equal [$dimObj cget -type ] DIAMETER ] } {

			# get the tolerance
			set tol 	[$dimObj cget -tolerance ]
			# assign lower, upper value
			set toll 	[lindex $tol 0 ]
			set tolu 	[lindex $tol 1 ]
			#export if inspection or basic
			set insp 	[$dimObj cget -inspection ]
			set basic 	[$dimObj cget -basic ]

			set data [join [list $sym [format %.3f $val] $toll $tolu $B($insp) $B($basic)] $sep]
			puts $fp $data
		}


	}

	# close the file
	close $fp

}

 

Just plain Tcl 

Oct 28, 2024 9:26 AM UTC

Just plain Tcl 


Good... But ho to use this example?

Nov 5, 2024 6:12 PM UTC

Hmm, check the Tcl Wiki, write a Mail, get the env, be surprised 😉