Add magnet position extraction script
This commit is contained in:
		
							parent
							
								
									31a2729cf1
								
							
						
					
					
						commit
						2d41e30072
					
				
					 1 changed files with 9 additions and 0 deletions
				
			
		
							
								
								
									
										9
									
								
								Mechanical/extract_magnets.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								Mechanical/extract_magnets.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,9 @@
 | 
			
		|||
import FreeCAD
 | 
			
		||||
 | 
			
		||||
doc = FreeCAD.open("STM-Frame.FCStd")
 | 
			
		||||
magnets = doc.findObjects(Label="Magnet.*")
 | 
			
		||||
for m in magnets:
 | 
			
		||||
    if m.TypeId != "App::Link":
 | 
			
		||||
        continue
 | 
			
		||||
    pos = m.Placement.Base
 | 
			
		||||
    print(f"{pos.x:.5f}, {pos.y:.5f}, {pos.z:.5f}")
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue