I've been experimenting over the weekend and discovered that you can drag a dxf into a sketch and it becomes a sketch block.
Pretty cool stuff, but there is no import options dialog to specify the units and somehow the dimensions are coming in as inches, so my 100mm edge becomes 2540mm.
My part templates are all in mm.
I can fix this by applying a scale parameter in the block properties but it would be nice to make it just work.
I checked out the help but ominously it states
The DXF/DWG Import Wizard appears during most import operations.
Not really relevant but I am using netDxf to create dxf's and then importing them into SW.
I have tried changing the dxf header variables but it didn't make any difference.
Code: Select all
HeaderVariables headerVariables = new ();
headerVariables.AcadVer = DxfVersion.AutoCad2013;
headerVariables.LUnits = netDxf.Units.LinearUnitType.Decimal;
headerVariables.InsUnits = netDxf.Units.DrawingUnits.Millimeters;
headerVariables.AddCustomVariable(new ("$MEASUREMENT", 70, (short)1)); // Metric
var doc = new DxfDocument(headerVariables);
var exDims = new ExDims(100, 150);
EntityObject entity = new Polyline(vertexes: CreateVectors(exDims.Coordinates()), isClosed: true);
doc.AddEntity(entity);
IMargin margin = new EqualMargin(10);
entity = new Polyline(CreateVectors(margin.Coordinates(exDims)), true);
doc.AddEntity(entity);
doc.Save("C:\\temp\\test.dxf");
I have also tried general import setting using document specified unit
Anyone know if this is possible?
Just to restate I'm not looking to import as a sketch, but directly as a sketch block.
Thanks for looking