是的,這是一個已知的問題,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