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
    ------------------------------



  • 14.  RE: functions icons dimensions

    Posted 02-03-2025 05:54
    I can't find those functions.


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



  • 15.  RE: functions icons dimensions

    Employee
    Posted 02-03-2025 08:57

    Hi

    Which functions do you refer to?



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



  • 16.  RE: functions icons dimensions

    Posted 02-03-2025 09:36



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



  • 17.  RE: functions icons dimensions

    Employee
    Posted 02-04-2025 01:31

    These are custom tools from MapCAD. According to this website, these are the tools in MapCAD that can be executed from MapBasic via the EXEC command:

    • CreateParallel
    • CalcAngle
    • CalcDirection
    • CartesianDirection / SphericalDirection
    • ReverseLineDirection
    • SplitToLines
    • ConvertToLine
    • LineIntersectionPoint
    • CreateSpline
    • CreateScaledObject
    • MirrorHorizontal
    • MirrorVertical
    • FitObjects
    • RotateText
    • CircleFromPointsXY (build 34)
    • ArcFromPointsXY (build 34)

    I'd think LineIntersectionPoint is used for Interseccion de arcos. I don't see the other tools listed.

    You can also find more documentation on the website mentioned above.

    Are you trying to recreate those tools? Why not just use the existing tools?



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



  • 18.  RE: functions icons dimensions

    Posted 02-04-2025 03:03
    The thing is that we want to unify the dimension tools within a custom tab, along with other functions.


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



  • 19.  RE: functions icons dimensions

    Employee
    Posted 02-06-2025 02:32

    In the MapCAD library in the Local AppData folder, you can find the file MapCADResources.xml.

    It contains details about the tools in MapCAD. The dimension tools are described like this:

    <Control Name="CreateMenuGroup" Caption="" Index="0" Type="DropDownMenuGroup" Enabled="true" Visible="true" Application="MapCAD">
    	<Controls>
    		<Control Name="DimensionButton2" Caption="Ruler" Index="0" Calling="1710" Type="Button" Enabled="false" Visible="true" IsLarge="true" ModifierKeys="true" SmallIconName="images/mapping/measure_16x16.png" LargeIconName="images/mapping/measure_32x32.png" IconDLL="MapInfo.StyleResources" ToolTipText="Displays the distance between two map points." HelpId="67246" Requires="FrontMap" Application="MapCAD" />
    		<Control Name="DimensionLineButton" Caption="Dimension Line" Index="1" Calling="DimensionLine" Cursor="306" DrawMode="33" Type="ToolButton" Enabled="false" Visible="true" IsLarge="true" ModifierKeys="true" SmallIconName="images/spatial/DimensionLine_16x16.png" LargeIconName="images/spatial/DimensionLine_32x32.png" IconDLL="MapInfo.StyleResources" ToolTipText="Create a dimension line in a separate layer." ToolTipDescription="Dimension Line" HelpId="1020" Requires="FrontMap" Application="MapCAD" />
    		<Control Name="DimensionLineContinuousButton" Caption="Continuous Dimension Line" Index="2" Calling="DimensionLineContinuous" Cursor="306" DrawMode="36" Type="ToolButton" Enabled="false" Visible="true" IsLarge="true" ModifierKeys="true" SmallIconName="images/spatial/DimensionLineContinuous_16x16.png" LargeIconName="images/spatial/DimensionLineContinuous_32x32.png" IconDLL="MapInfo.StyleResources" ToolTipText="Create a dimension line with cumulated distance and distance to objects." ToolTipDescription="Continuous Dimension Line" HelpId="1015" Requires="FrontMap" Application="MapCAD" />
    		<Control Name="IntersectingArcsButton" Caption="Intersecting Arcs" Index="3" Calling="ArcIntersection" Cursor="310" DrawMode="34" Type="ToolButton" Enabled="false" Visible="true" IsLarge="true" ModifierKeys="true" SmallIconName="images/spatial/intersectingarcs_16x16.png" LargeIconName="images/spatial/intersectingarcs_32x32.png" IconDLL="MapInfo.StyleResources" ToolTipText="Intersection of two arcs by giving center points and radiuses. A sketch of both arc intersection points will be calculated and displayed in the cosmetic layer." ToolTipDescription="Intersecting Arcs" HelpId="1013" Requires="FrontMap" Application="MapCAD" />
    	</Controls>
    </Control>

    I have however never tried to create a button that calls the functionality in another tool so I'm unsure if this will work.



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



  • 20.  RE: functions icons dimensions

    Posted 02-06-2025 02:44
    Edited by Peter Møller 02-07-2025 01:16

    I have this rule button, how do I do the split with the commands you tell me?

    Dim reglaBtn  as This
    
    reglaBtn = MICtrlCollAddStrStrInt(EielControlExplorar, "Arastrar", "Regla", ControlType_ToolButton) 'ControlTypes are defined in Enums.def
    Call SetRbnToolBtnCtrlCmdId(reglaBtn, M_TOOLS_RULER)
    Call SetRbnToolBtnCtrlIsLarge (reglaBtn, TRUE)
    Call SetRbnToolBtnCtrlLargeIcon(reglaBtn, New_Uri("pack://application:,,,/MapInfo.StyleResources;component/Images/Layout/ruler_32x32.png", 0)) 


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



  • 21.  RE: functions icons dimensions

    Employee
    Posted 02-07-2025 01:31

    Hey

    Something along these lines but I haven't tested it.

    In fact, I'm not sure you can call a procedure in another running MBX in this simple way.

    Dim reglaBtn  as This
    
    reglaBtn = MICtrlCollAddStrStrInt(EielControlExplorar, "Arastrar", "Regla", ControlType_ToolButton) 'ControlTypes are defined in Enums.def
    Call SetRbnToolBtnCtrlCallingHandler(reglaBtn, "DimensionLine")
    Call SetRbnToolBtnCtrlIsLarge (reglaBtn, TRUE)
    Call SetRbnToolBtnCtrlDrawMode(reglaBtn, 33)
    Call SetRbnToolBtnCtrlCursorId(reglaBtn, 306)
    Call SetRbnToolBtnCtrlLargeIcon(reglaBtn, New_Uri("pack://application:,,,/MapInfo.StyleResources;component/Images/Layout/ruler_32x32.png", 0)) 


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



  • 22.  RE: functions icons dimensions

    Posted 02-11-2025 13:36

    Not working



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