Jump to content

Problem with reset zoom in script


---
 Share

Recommended Posts

Hi,

I have a problem with the script recorder to take the image of a 3D comparison. I want to take the image of whole part, and when I record using the function "Reset Zoom" it succeed, but when I run the script it doesn't work. The first is the image taken when I record the script, the second one is the image taken running the script. The part is cut. And this is the code I used. Why it doesn't work? I am wrong with something? Thank you very much.

# -*- coding: utf-8 -*-

import gom

gom.script.cad.show_element_exclusively (elements=gom.ElementSelection ({'category': ['key', 'elements', 'part', gom.app.project.parts['Part'], 'explorer_category', 'inspection', 'object_family', 'surface_comparison', 'type', 'surface_comparison']}))

gom.script.view.adapt_zoom (use_animation=False)

gom.script.report.create_report_page (
	animated_page=False, 
	animation=['snapshot_frame_6', 'Animation by all stages, 12.0s (2)'], 
	imitate_fit_mode='overwrite', 
	template_name='Report_Bitron_A4_Horizontal_Stage_Vecchio_Nuovo_a4', 
	template_orientation='landscape', 
	template_package={'name': 'Bitron', 'uuid': '11a448bd-b5a9-4f56-acfe-5d55966554dc', 'version': '1.0.79'}, 
	title='$format (page_number, "", show_unit=false, date_format=\'dd/MM/yyyy\')$ - $format (number_of_pages, "", show_unit=false, date_format=\'dd/MM/yyyy\')$')

 

CopyQ.CqJymH.png.68545606ea1af0970f53780438246daa.png

CopyQ.UYUlUE.png.ad34f88d5084f02d58cf0e2d10f7337b.png

Link to comment
Share on other sites

Hi,

I had this exact problem before and to me it seemed to be because of the screen resolution. I don't like it, but try switching to 1920x1200 and see if it helps you. 

Link to comment
Share on other sites

Hi! Thank you very much, but my monitor isn't able to use this resolution. I'll try to do some tests with resolution. Thank you!

Link to comment
Share on other sites

Hi , i guess one question here is ' why do you want to do this ' .  My guess : you have lots of different parts that you want to evaluate and you always want to have certain views from surface comparisons?  As such feels like a job for a script?

 

The views in reports are not so easy to handle via code and ive never found anything completely robust. 

Maybe you can clarify why you want to do this and there may be a different way or something for the software development to think about.

Link to comment
Share on other sites

Hi James,

thank you for your response! I have to do this because I have made a script that automatically, starting from a actual/CAD comparison, make a actual/actual comparison (example: actual part on past month part) and automatically generate 8 views for see the comparison all around. I created a report style with eight placeholder for 3D view and in the first one I have the problem reported in this thread.

I hope I explained myself.

Thank you very much for your support!

Link to comment
Share on other sites

Hey Marco, i would go a different way here.   I would use a project with two parts.

 

  One part containing cad , one part containing a nominal stl that is the ' month before ' .   

Now this month before model would need exporting in the appropriate alignment.

The alignment of the current part will be to cad - then in that alignment do a comparison to the nominal mesh in the other container.

In this way you can  set up all your views you need.

Then when next month happens you can exchange the nominal mesh for a new nominal mesh .

The parametrics will then deal with the reporting and views - as they are linked to the nominal mesh and subsequent child surface comparison.

 

It then depends how complex you want to or need to get  as you might use code to search for stls in a directory with certain names or dates and do this exchange

 

I really hope this makes sense!!

It is always my goal to make best use of the parametrics !!

 

 

Link to comment
Share on other sites

If you want I can post my script, so you can see it and tell me what you think about, and other users can use it. Monday I will post it!

Link to comment
Share on other sites

 Share

×
×
  • Create New...