MapInfo Pro Developers User Group

 View Only
Expand all | Collapse all

functions icons dimensions

  • 1.  functions icons dimensions

    Posted 05-13-2024 02:52
    What functions in the MENU.def file correspond to the following icons?
    The first is M_TOOLS_RULER and the rest?


    Thanks


    ------------------------------
    Mayca González Pérez
    COMUNIDAD. AUT. REG MURCIA
    ------------------------------


  • 2.  RE: functions icons dimensions

    Employee
    Posted 05-13-2024 09:44

    The other 3 are features from MapCAD so they aren't referenced in the menu.def



    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------



  • 3.  RE: functions icons dimensions

    Posted 05-13-2024 15:18
    And how can I call those functions from MAPBASIC?


    ------------------------------
    Mayca González Pérez
    COMUNIDAD. AUT. REG MURCIA
    ------------------------------



  • 4.  RE: functions icons dimensions

    Employee
    Posted 05-14-2024 03:08

    Hi

    Several of the MapCAD functions can be called via the Exec() function through MapBasic.

    Check out this document: MapCAD Tools Executable via Exec() function 



    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------



  • 5.  RE: functions icons dimensions

    Posted 05-14-2024 16:21

    Ok. Thanks



    ------------------------------
    Mayca González Pérez
    COMUNIDAD. AUT. REG MURCIA
    ------------------------------



  • 6.  RE: functions icons dimensions

    Posted 05-16-2024 06:47
    Edited by Peter Møller 05-17-2024 01:23

    Ok we have this function, but how can I make the points dynamic. That is, the user points them out

    'Creates a new circle object.
    Dim NewObj as object
    NewObj = Exec("MapCAD.mbx","CircleFromPointsXY", 
                   434204.02,5566829.13,434219.39 ,5566833.997,434218.18,5566852.19)
    Insert into [Table] (obj) values (NewObj)

    'Updates objects with calculated circles from coordinate columns (X1 ...Y3).
    Update [Table] set obj=Exec("MapCAD.mbx","CircleFromPointsXY", X1, Y1, X2, Y2, X3, Y3)

    ------------------------------
    Mayca González Pérez
    COMUNIDAD. AUT. REG MURCIA
    ------------------------------



  • 7.  RE: functions icons dimensions

    Employee
    Posted 05-17-2024 01:29

    Hi Mayca

    There may be a few ways to pick up these coordinates from the map.

    1. You can create a toolbutton with a Point drawmode and every time the user has clicked three times, you can create a circle using the last three points.
    2. You can create a toolbutton with a Polyline drawmode and ask the user to create a polyline with 3 points. When the user ends the polyline, extract three nodes from the polyline and build a circle using these.

    The polyline method could be tricky as the user could, by accident, click more than three times. I would use the first three points from the polyline or the first two and the last.

    Are you recreating the tool to ensure the circle is created in the right layer?

    I hope this helps



    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------



  • 8.  RE: functions icons dimensions

    Posted 05-20-2024 12:34
    Okay. It has worked.
    Now my doubt arises to save it in the database. I have a database in ORACLE. In the MAPINFO_MAPCATALOG table in the SPATIAL field I have defined 13.3.
    When I hit save it gives me the following error.How can I define the table so that it allows me to save that geometry?


    ------------------------------
    Mayca González Pérez
    COMUNIDAD. AUT. REG MURCIA
    ------------------------------



  • 9.  RE: functions icons dimensions

    Employee
    Posted 05-21-2024 02:02
    Edited by Peter Møller 05-25-2024 01:20

    Oracle doesn't support these "cosmetic" object types like ellipse, rectangle, and similar.

    You will have to convert these to polygons/regions and/or polylines.

    You can do this using the ConvertToRegion() and ConvertToPline() functions in MapBasic.



    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------



  • 10.  RE: functions icons dimensions

    Posted 05-23-2024 14:57

    Hi.

    When converting I get an error when compiling
    Unrecognized command: (. 
    Dim i_obj_type As SmallInt, x1, y1, x2, y2, x3,y3  As Float, new_pnt As Object
    i_obj_type = ObjectInfo(objOBJECT, OBJ_INFO_TYPE) 
    ' ... then the object is a polyline... 
    x1 = ObjectNodeX(objOBJECT, 1, 1) ' read longitude
    y1 = ObjectNodeY(objOBJECT, 1, 1) ' read latitude
    x2 = ObjectNodeX(objOBJECT, 1, 2) ' read longitude
    y2 = ObjectNodeY(objOBJECT, 1, 2) ' read latitude
    x3 = ObjectNodeX(objOBJECT, 1, 3) ' read longitude
    y3 = ObjectNodeY(objOBJECT, 1, 3) ' read latitude
    print x1+","+y2+","+x2+","+y2
        objOBJECT= Exec("MapCAD.mbx","CircleFromPointsXY", x1,y1,x2,y2,x3,y3) 
        objOBJECT = ConvetToRegion(objOBJECT)


    ------------------------------
    Mayca González Pérez
    COMUNIDAD. AUT. REG MURCIA
    ------------------------------



  • 11.  RE: functions icons dimensions

    Employee
    Posted 05-25-2024 01:20

    It seems I misspelled ConvertToRegion in my previous post. You are missing an r in the function name.

    If have fixed the misspell in the previous post



    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------



  • 12.  RE: functions icons dimensions

    Posted 05-28-2024 01:10
    I'm sorry. What a stupid mistake


    ------------------------------
    Mayca González Pérez
    COMUNIDAD. AUT. REG MURCIA
    ------------------------------



  • 13.  RE: functions icons dimensions

    Employee
    Posted 05-28-2024 06:09

    No worries, Mayca, we have all been there where we can't see the forest for all the trees :-)

    And I should have checked my answer before posting it too.



    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------