是的,这是一个已知的问题,Sketchup不能正确导入非常小的边/面。您可以使用此Ruby脚本自动化虽然在升级模型的导入过程:
model = Sketchup.active_model
# Import your dwg file, true if you want the summary screen
model.import 'C:\path\to\example.dwg', false
# Reset the selected tool
model.select_tool(nil)
# Get all imported faces
faces = model.entities.grep(Sketchup::Face)
# Create a new ComponentDefinition
definition = model.definitions.add "dwg"
# Add the points of every face to the definition
faces.each{|f| definition.entities.add_face f.vertices}
# Remove all entities
model.entities.clear!
# Create a new DefinitionInstance that is scaled by 0.5
transformation = Geom::Transformation.new(0.5)
instance = model.entities.add_instance definition, transformation
# Explode the component to work with the model
instance.explode
这增加了该组件的来源和需要缩放导入模型回来照顾。如果您的型号为skp
文件,您甚至可以直接将其加载到ComponentDefinition
,但这对于dwg
文件不起作用。
似乎'model.select_tool(nil)'取消了导入命令。我在Mac OS X上用Sketchup版本16.1.1451 –
似乎与http://forums.sketchup.com/t/ruby-api-model-importtopoint/18747 –
嗯,太糟糕了,在我的Windows机器上工作。如果你跳过这一行会发生什么? – Sven