News:

Please note new Forum URL: forum.designcad.com

Main Menu
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.

XYZ files

Started by The Scud, August 16, 2013, 09:21:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

The Scud

 :-[ Dumb question here, I have done this before and it has gone from my grey matter. I have a excel spreadsheet with XYZ plots. What do I save the spreadsheet file as DC cannot see the file I am looking for.
BETA tester from long ago.
User of:
SolidWorks 2024, CREO10 and TurboCAD Professional.
FIM Senior Technical Steward for MotoGP.
Work at: Semi-retired..

samdavo

#1
csv m8 - comma separated value , with other alias's ( according to wiki)
QuoteA comma-separated values (CSV) (also sometimes called character-separated values, because the separator character does not have to be a comma) file stores tabular data (numbers and text) in plain-text form. Plain text means that the file is a sequence of characters, with no data that has to be interpreted instead, as binary numbers. A CSV file consists of any number of records, separated by line breaks of some kind; each record consists of fields, separated by some other character or string, most commonly a literal comma or tab. Usually, all records have an identical sequence of fields.

I believe it's the best format if you're using Microsoft Excel,  (as DT recommended once way back).

Personally I so much prefer to use Lotus 123, lol , from 1997 and/or 2000 - prints direct  to ".XYZ" files - and in one macro (in Lotus)  I spit out 5 XYZ files for 5 layers of my drawing - and then in one macro I import them into DCAD (each to its own layer and colour).   Layers 2 to 6 incidentally.  ( I keep Layer 1 for manually added text etc) .   Works like a dream, and I've been using it since the mid 90's or before.

I have yet to set it up in 3D, but would be simple (if I could just get or make the time) - "later".

Here's the macro btw :-
The last few steps involve setting a handle and dragging the top half of the imported files up by 1000mm. - optional of course, but I might as well leave it in

'IMPORT5.D3M loads five XYZ files from spreadsheet in layers
'files called L2.xyz, L3.xyz, L4.xyz, L5.xyz and L6.xyz
'firstly set all layers visible and edible
'including purple cursor and selections
'(amended 20130510)

for j = 0 to 255
layer(j) = 6
next j
layer(sys(3))=14
sys(26)=0

'background
sys(321)=0
sys(322)=0
sys(323)=0

'point =purple
sys(312)=130
sys(313)=0
sys(314)=255

'cursor =purple
sys(331)=130
sys(332)=0
sys(333)=255

'set rubberband = purple
sys(306)=130
sys(307)=0
sys(308)=255

'set selection rubberband to purple
sys(324)=130
sys(325)=0
sys(326)=255

'selection to purple
sys(315)=130
sys(316)=0
sys(317)=255

'next load L2.xyz as red layer2, etc
>XyzIn
{
  <Layer 2
  <color 255,0,0
  <Filename "C:\2000dc\A4\L2.xyz"
  <Size 0.5000
  <Type 1
  }

>XyzIn
{
  <Layer 3
  <color 255,130,0
'brown
  <Filename "C:\2000dc\A4\L3.xyz"
  <Size 0.5000
  <Type 1
  }

>XyzIn
{
  <Layer 4
  <color 0,255,0
  <Filename "C:\2000dc\A4\L4.xyz"
  <Size 0.5000
  <Type 1
  }

>XyzIn
{
  <Layer 5
  <color 0,255,255
  <Filename "C:\2000dc\A4\L5.xyz"
  <Size 0.5000
  <Type 1
  }

>XyzIn
{
  <Layer 6
  <color 255,0,255
  <Filename "C:\2000dc\a4\L6.xyz"
  <Size 0.5000
  <Type 1
  }
 
'next select plan and move up 1000mm
>DragSelect
{
  <PointXYZ 1000,1000,0.0000
  <PointXYZ 0.0000,0.0000,0.0000
  <Type 0
  }

>SetHandle
{
  <PointXYZ 0.0000,0.0000,0.0000
  <PointXYZ 0.0000,0.0000,0.0000
  }

>SelectMove
{
  <PointXYZ 0.0000,1000.0000,0.0000
  <Type 1
  }

>FitToWindow
{
  }

Looking at it now, I suspect some errors and/or clumsiness, but it still works lol

samdavo

Actually I'd really appreciate it if someone could confirm that you can easily write a macro in Excel that saves five sets of XYZ coordinates ( i.e. five named ranges)  as five csv files .

and maybe add a few tips on how.  (I am not as good with Excel as I am with Lotus).

samdavo

#3
I attach a screendump
a. after running the macro IMPORT5.d3m (see the attachment to reply #1  ;  and
b. after mirroring as required, (see attachment to this reply)

Herewith macros to mirror vertically, horizontally :-
'Mirror Vert.d3m mirrors a selection vertically
>SetStartPoint
{
  }
>SetHandle
{
  <PointXYZ 0.0000,0.0000,0.0000
  <PointXYZ 0.0000,0.0000,0.0000
  }

>SelectMirror
{
  <PointXYZ 0.0000,0.0000,0.0000
  <Axis 1
  <Type 1
  }
regen


'Mirror Horiz.d3m mirrors a selection horizontally
>SetStartPoint
{
  }
>SetHandle
{
  <PointXYZ 0.0000,0.0000,0.0000
  <PointXYZ 0.0000,0.0000,0.0000
  }

>SelectMirror
{
  <PointXYZ 0.0000,0.0000,0.0000
  <Axis 0
  <Type 1
  }
regen


B4.d3m is a macro to mirror BOTH horizontally and horizontally
'for example, choose a point at low left corner of a quadrant after clicking the macro icon
>SetStartPoint
{
  }

SYS(242)=1

>SetHandle
{
  <PointXYZ 0.0000,0.0000,0.0000
  <PointXYZ 0.0000,0.0000,0.0000
  }

>SelectMirror
{
  <PointXYZ 0.0000,0.0000,0.0000
  <Axis 0
  <Type 1
  }

>SelectPrevious
{
  }

>SelectMirror
{
  <PointXYZ 0.0000,0.0000,0.0000
  <Axis 1
  <Type 1
  }

>SetHandle
{
  <PointXYZ 0.0000,0.0000,0.0000
  <PointXYZ 0.0000,0.0000,0.0000
  }

>SelectMirror
{
  <PointXYZ 0.0000,0.0000,0.0000
  <Axis 0
  <Type 1
  }

SYS(242)=0
>regenerateall
{
}