Subscribe to this thread
Home - General / All posts - is it possible to automatically copy x(intrinsic) to x(data)?
aacuabo3 post(s)
#02-Sep-19 08:46

noob here, is it possible to automatically copy x(intrinsic) to x(data)

thanks!!!

Attachments:
Untitled.png

aacuabo3 post(s)
#02-Sep-19 09:04

anyhow, any recommendation for further information for manifold?

ColinD


1,924 post(s)
#02-Sep-19 10:33

http://www.manifold.net/doc/mfd9/

http://www.georeference.org/doc/manifold.htm#


Aussie Nature Shots

KlausDE

6,343 post(s)
#02-Sep-19 19:10

Some basics.

Assuming you have a drawing with some objects called [Drawing]

  • Open a View->New Command Window->SQL. It opens in Query Builder mode.
  • Drag [Drawing from the Project pane into the empty area down left. The structure of the table is shown.
  • Type SELECT in the filter box above the SQL phrases at the right side.
  • Double click the SELECT ... line and the basic syntax is copied into the command window.
  • Select the <table> substitute by doubleclick and replace it with a doubleclick on [Drawing].
  • Select the fields list between SELECT and FROM and in the Filter for SQL phrases search for functions that work with geoms. So filter for 'Geom'. You can get closer as you want to get the Coordinates in the Geom. So set the Filter to 'GeomCoord'. Now what you need is easy to find:
  • Doubleclick 'GeomCoordXY(..)' and it replaces the selected fields list.

Not that 'GeomCoordXY()' returns a valuex2, a 2-dimensional point.

  • In the command Window select <geom> and as you already guess replace it with [Geom] of your [Drawing] with doubleclick.
  • <coord> is the index of the coordinate in the object. For points it's 0.
  • Run the query for a test, It returns [x, y] pairs of coordinates. I.e. a vector of 2 values.
  • Click the Query builder tab to return tu the list of SQL phrases and filter for 'Vector'
  • In the list you see a function VectorValues(<valueNx>, <index>) that returns a value
  • Set the cursor in front of GeomCoordXY(... an insert VectorValues template with doubleclick.
  • Of course GeomCoordXY() returns your <vectorNx> and the index of x is 0. So you shuffle the command to read
  • ... VectorValue(GeomCoordXY([Geom], 0), 0) ...

and run.

SQL is really easy to learn this way.

To wrap this in an UPDATE and SET values in another field use the Query Builder again.

-- SQL9

UPDATE

( SELECT [mfd_id],

 VectorValue(GeomCoordXY([Geom], 0), 0),

 x

 FROM [Drawing]

)

SET [x] = [result];

Update needs a unique identifier to work. That's why [mfd_id] comes in.

tjhb

8,846 post(s)
#02-Sep-19 23:41

This is excellent for Manifold 9.

OP aacuabo seems to be using Manifold 8.

aacuabo3 post(s)
#03-Sep-19 01:30

this is great! THANKS A LOT!!!!

Manifold User Community Use Agreement Copyright (C) 2007-2017 Manifold Software Limited. All rights reserved.