DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Draw in inches and output dxf in mm

Started by leroy, January 31, 2009, 04:55:03 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

leroy

I had 18 working where I could draw and save a dc file in inches.  and export in mm's.  I change something and can't figure out how to get back to what I need.  I need the mm's because I have a good size laser and a cnc foam cutter and the both use mm's.  I can convert inches to mm's manually like I use to do but letting the machine do it is much easier.

bdeck

#1
Hi leroy,

In either Version 17 or v18, if you export a dxf file and reimport it, it will have inch units regardless of the units of measurment of the source drawing, and regardless of the option settings for units of imported drawings in the Optoins/units of measurement menu.

I think the error is with import only, but I have no way to test. At any rate, it should not seriously affect your export for cnc use, as dimension text is problably not important to you so long as the scaling is correct.

Also, if one checks the rescale checkbox in Options/Units of Measurement, any subsequent dimensions and text will not be drawn correctly to the new scale.

Have either of these issues been fixed in version 19? 

In the meantime, here is a macro that simplifies the process of scaling a file for export, without corrupting the source.

It's probably far more complex than it needs to be, simply because of lack of documentation. For example, the function and scope of sys(1100), sys(1101) and sys(1102) is a total SWAG.*

BD


PS:  Here's another bug that turned up while testing this macro.
       SelectPrevious fails after SelectAll in versions 15.3-18.2.


Edit 2/01/09  fixed duplication error for sys1100=4 where it should have been 6 or 7.



*scientific wild ass guess


Note:  An improved version is attached to following post.


'dxfmm.d3m   macro to export a dxf file scaled to mm  bdeck 1/09

'Set constants first. Paramters for dxfout function:

t=2      ' save as version 14
h=1     ' There shouldnt be any hatches in cnc work, if there are, then change them to lines.
          ' this version does not export grids.


sys3$=sys$(3)

sys1100=sys(1100)
sys1101=sys(1101)
sys1102=sys(1102)

sys(1101)=sys(1100)

ns=sys(80)  'get number of selected ents


if ns>0 then
    Sys(1027) = 4 'Yes/No MessageBox style    message "current selection only?"
    message "Export Current Selection ONLY ? "
    If Sys(1028) =7 Then ns=0     ' if no then select all
    If Sys(1028) =2 Then end      ' if cancel then end all
    Sys(1027) = 0
endif

if ns=0 then   'if no prior selection then select all
    >SelectAll
    {
    }
endif

hx=sys(190)
hy=sys(191)
hz=sys(202)

>Copy
{
}
if ns=0 then
    >selectprevious
    {
    }
endif
>New
{
}

sys(1101)=sys1101  'restore prior value
sys(1102)=sys1100

>paste
{
<type 1
<pointxyz [hx,hy,hz]
}


sys(1102)=sys1102   'restore prior value

if sys1100=0 then zf=25.4              ' assume unitless = inches
if sys1100=1 then zf=25.4
if sys1100=2 then zf=25.4*12
if sys1100=3 then zf=25.4*12*5280
if sys1100=4 then zf=1
if sys1100=5 then zf=10
if sys1100=6 then zf=1000
if sys1100=7 then zf=1000000

sys(1100)=0                           ' change to unitless

>SelectScaleOrtho
{
<Zoomfactor [zf]                'scale for mm
}

sys(1100)=4                             ' Optional change units to mm


sys$(3)=sys3$

>DxfOut
{
<Type [t]
<HatchType [h]
<incomplete
}

>Close    ' close the temporary drawing
{
<SaveChanges 0
}


end

bdeck

Attached is another version with some minor positioning changes, and a working preview screen.

bdeck

Quote from: bdeck on January 31, 2009, 12:22:43 PM
Have either of these issues been fixed in version 19? 

Anybody?

Bueller?

Also, besides the 3 bugs reported above, How does v 19 deal with these other old issues?

4) V 18.2 exports 13 dimension points to prior versions? (where only 12 are called for)
5) V 18.2 explodes dimensions when exporting to dc2.


BD

Rob S

I have the shipping version of V19

Can you tell me how to test for these bugs mentioned above, and I 'll do it!
User since forever

bdeck

#5
Hi  Rob,

You da man.


1) Import Units of measurement bug.

Take any drawing in DC in V 18.2 (with or without dimensions)

In Options/Units Of Measurement set all options to unitless (no check box)

Export to dxf.

Open an new blank file

In Options/Units Of Measurement set all options to unitless (no check box)

Import the dxf file.

In Options/Units Of Measurement the currenf file units will now be inches.


2) Rescale Units of measurement bug

In Options/Units Of Measurement set the current drawing to Inches.

Make a simple drawing in inch units. Add some text and a dimension.

In Options/Units Of Measurement set the current drawing to mm. Check the rescale box.

Now draw another dimension. See the difference.

This is an understandable programming oversight. Existing text and dimensions are properly rescaled just as every other entity on the drawing. The parameters should also be updated so that new dimemensions are scaled identically to the old ones.


3) SelectPrevious fails after SelectAll.

Create a drawing with multiple entities.

Select one entity.

Next Edit/SelectAll.

Next Edit/SelectPrevious.

The first entity should be selected, but is not.

I just noticed this issue myself, even though it has been there a long time. Obviously not a biggy, but can be critical in some macro situations.  The problem is that the SelectAll command does not update ent_selected correctly.


4) V 18.2 exports 13 dimension points to prior versions (where only 12 are called for)

Using Point Select Mode:

Create a simple @ type dimension in version 17 or earlier. Select the dimension and then use the APW macro to examine the 12 points that make up the dimension.

Now open the file in version 18. Save the file as version 17 and as version 18. Open them both with version 17 and examine the dimension again with APW. Notice the immovable  13th point creating a vector parallel to the dimension line, that serves no useful purpose.


5) V 18.2 explodes dimensions when exporting to dc2.

In version 18.2, save a file having dimensions as a 2D ascii file.

Now reopen the file in any version. The dimension will be gone, replaced by vectors and text and arrows.


Thanks

BD

Rob S

#6
1) Import Units of measurement bug.

Appears to be fixed


2) Rescale Units of measurement bug

Text is rescaled, dimension parameters are not.  Perfect use for our dss05 macro!!


3) SelectPrevious fails after SelectAll.

Not fixed in V19, works correctly in V17


4) V 18.2 exports 13 dimension points to prior versions (where only 12 are called for)

Yikes - still there in 19.  Also, the superfluous point is hidden near where the real endpoint of the extension line should be, so it could easily lead to errors in repositioning a dimension by its dimension points


5) V 18.2 explodes dimensions when exporting to dc2.

Not fixed in V19



User since forever

bdeck

Hi Rob,

Thanks for the heads up.

No need for the red lettering. Its not that bad  ;D

This gives us a headstart on 19.1.

I rechecked my versions:

2) Mea culpa. Text on my version 18 works correctly also. Only Dim parameters fail to update.

3) SelectAll On my versions 15.3 - 18.2 does not work with selectPrevious.


I'm looking forward to doing some sculpting with trimmed curves.


BD



Rob S


We used to use the red and green lettering in our summary lists on the beta forum for the unfixed/fixed.

I took out the bold to reduce the fear factor a bit  ;D
User since forever

paulerens

Rob,

3) SelectPrevious fails after SelectAll.

Works for me  in (beta 19.5)