Getting model size for post processor

Getting model size for post processor

erik.valtanen
Contributor Contributor
544 Views
1 Reply
Message 1 of 2

Getting model size for post processor

erik.valtanen
Contributor
Contributor

Hello,

 

I would like to know if you can somehow get the 3D-models dimensions used in a program to post prosessor. The "Block" parameter only seems to give you the extents of current toolpath and is not really giving accurate results in simulation and other things.

Block size.JPGI tried searching through program classes, but there is nothing resembling "Model". Can it be done?

 

Thanks

 

Erik 

0 Likes
545 Views
1 Reply
Reply (1)
Message 2 of 2

rafael.sansao
Advisor
Advisor

You will need to use a macro to calculate the model limits and write the NC Program:

 

Real List Xmax = {}
Real List Xmin = {}
Real List Ymax = {}
Real List Ymin = {}
Real List Zmax = {}
Real List Zmin = {}
FOREACH $M IN FOLDER ("MODEL") {
	REAL ARRAY Lims[] = limits('model',$M.name)
	int a = add_last(Xmax, round($Lims[1],5))
	int b = add_last(Xmin, round($Lims[0],5))
	int c = add_last(Ymax, round($Lims[3],5))
	int d = add_last(Ymin, round($Lims[2],5))
	int e = add_last(Zmax, round($Lims[5],5))
	int f = add_last(Zmin, round($Lims[4],5))
}
Real Model_Max_X = max(Xmax)
Real Model_Min_X = min(Xmin)
Real Model_Max_Y = max(Ymax)
Real Model_Min_Y = min(Ymin)
Real Model_Max_Z = max(Zmax)
Real Model_Min_Z = min(Zmin)

KEEP NCPROGRAM ;

 

You will need to create 6 user parameters in your Postprocessor:

udp_Model_Max_X

udp_Model_Min_X

udp_Model_Max_Y

udp_Model_Min_Y

udp_Model_Max_Z

udp_Model_Min_Z

 

And add to the commands:

Capturar.PNG

 

This link can help you: https://forums.autodesk.com/t5/powermill-forum/replace-a-character-in-file-with-a-macro/m-p/6774411#...

Rafael Sansão

OptiNC - www.optinc.tech

EESignature

0 Likes