MapInfo Pro

 View Only
  • 1.  Create parallels from polylines

    Posted 09-22-2025 06:46
      |   view attached

    I work alot with drawing maps for dranage and want to make this a bit more effective. The issue is to make several parallels from polylines in a smarter and faster way. I know there is a tool for buffer wich make it possible to create one parallel from a polyline but my question is if there are some out in the community that have developted this tool to create several lines in one operation?



    ------------------------------
    Dag Hallén
    Self-Registration Shared Account
    ------------------------------


  • 2.  RE: Create parallels from polylines

    Posted 09-23-2025 01:04

    Hi Dag, you should be able to select all lines that you need (either by style/colour or attribute) and use that same buffer parallel to create the required distance on whatever side of the line ( you just need to be careful of the direction drawn of the line and make sure direction is all the same and not mishmashes) in one click rather than line at a time. Hopefully that helps. Use the marque select or region/polygon select if you only need to perform this parallel to particular set of lines. Let me know how you go. Cheers

    Teddy



    ------------------------------
    Teodora Stoyanov
    Knowledge Community Shared Account
    ------------------------------



  • 3.  RE: Create parallels from polylines

    Employee
    Posted 23 days ago
      |   view attached

    I'd better share the small sample app that we created here, too.

    The app adds a button to the ribbon that allows the user to select a single object and create multiple parallels on this selected object.

    The basics for creating multiple parallels is to create one multiple times:

    For i = 1 To GetNumParallels()
       NewObj = Exec("MapCAD.mbx","CreateParallel", OldObj, GetParallelDistance(), GetParallelOrientation(), FALSE, FALSE)
       insert into sBaseTable  (OBJ) Values (NewObj)
       OldObj = NewObj
    Next

    As you can see, we have decided not to create multiple parallels on the initial object, but create a parallel on the parallel object.

    This can, of course, be done in multiple ways.

    I wonder if using the MapBasic function Offset() would be just as good here as using the MapCAD CreateParallel() function?

    You can find the code and the compiled application in the attached file



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

    Attachment(s)

    zip
    SkapaParallel10mLeft.zip   4 KB 1 version