Identifying Objects

Discussion in 'AutoCAD' started by sreein78, Aug 11, 2004.

  1. sreein78

    sreein78 Guest

    Hi,

    I have recently developed an application using ACAD 2002., where in information regarding the buildings in the drawing can be drawn from the SQL database and further reports drawn.

    In this application, I have used the co-ordinates of the objects (top left & bottom right x,y coordinates). The problem I am facing is, I donot know how I can identify objects with no particular shape where I cannot pick up the co-ordinates. eg. I need to draw the information regarding the irrigation lines and these are spread all over with no particular pattern and shape.

    Is there any other way to identity ACAD objects other than using the co-ordinates.

    Kindly help. I

    Thanks and best regards,

    Sree
     
    sreein78, Aug 11, 2004
    #1
  2. If I understand you correctly, you're trying to duplicate the dwg entities
    in an SQL database.
    Yes, no easy task !!
    You have to create tables to handle each type of entity you need to store.
    For example, a polyline has bulge info, coordinates, fit data, etc., while
    an arc has center coordinates, initial angle, ending angle, and radius.

    --
    Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica


    information regarding the buildings in the drawing can be drawn from the SQL
    database and further reports drawn.
    & bottom right x,y coordinates). The problem I am facing is, I donot know
    how I can identify objects with no particular shape where I cannot pick up
    the co-ordinates. eg. I need to draw the information regarding the
    irrigation lines and these are spread all over with no particular pattern
    and shape.
     
    Jorge Jimenez, Aug 11, 2004
    #2
  3. sreein78

    sreein78 Guest

    Thank you very much Jorge.

    Let me just describe you briefly.

    We have different buildings, structures and so on in our site layout done in ACAD 2002. Now the information regarding these buildings : the equipments,details, maintenance activities etc is stored in a database. The application that I have developed is such that , if we move the mouse pointer over any building it gives a tooltip that briefs the user about certain information regarding the building. I have used the coordinates for this. I have a seperate table that hold the coordinate information for all the buildings. The main problem I ma facing is I am unable to represent the irrigation lines, valves etc systematically. I have used small rectangles spread over the areas to represent the irrigation lines and I have taken the coordinates of these rectangles. (very tedious method). It serves my purpose, but I would like to represent the irrigation lines more systematically say by spraying colours.

    Hope you have understood my concept.

    Is there any way by which I can identify these coloured areas in the database without using the coordinates ?

    Thanks and best regards,

    Sreejith
     
    sreein78, Aug 12, 2004
    #3
  4. Ok, I get the picture.
    Irrigation lines seems to be the main problem here, cause valves can be done
    with the bounding box coordinates.
    About the polylines, you can check if the current coordinate intersects the
    polyline. Use the bounding box to narrow down the search of which polylines
    (irrigation lines) you should check.

    --
    Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica


    in ACAD 2002. Now the information regarding these buildings : the
    equipments,details, maintenance activities etc is stored in a database. The
    application that I have developed is such that , if we move the mouse
    pointer over any building it gives a tooltip that briefs the user about
    certain information regarding the building. I have used the coordinates for
    this. I have a seperate table that hold the coordinate information for all
    the buildings. The main problem I ma facing is I am unable to represent the
    irrigation lines, valves etc systematically. I have used small rectangles
    spread over the areas to represent the irrigation lines and I have taken the
    coordinates of these rectangles. (very tedious method). It serves my
    purpose, but I would like to represent the irrigation lines more
    systematically say by spraying colours.
    database without using the coordinates ?
     
    Jorge Jimenez, Aug 12, 2004
    #4
  5. Are you familiar with Layers in ACAD? You could have a Layer named
    IRRIGATION and use it for the polylines or colored areas that you create.
    Then, when you are showing tooltips:
    -- loop through all polylines on layer IRRIGATION (use a filtered
    selection set to speed things up)
    -- with each polyline, loop through the segments
    -- check if the distance from the mouse to the polyline segment is within a
    tolerance
    -- if it is, show your tooltip

    I'm curious... What types of objects would you use to create the coloured
    areas?

    My main point is that for arbitrary lines, instead of checking whether the
    mouse is within a bounding box, it is much better to calculate the distance
    from the point to the line segment.

    There is code samples in the group to help with all of this, and I have some
    point-line distance functions.
    HTH,

    James
     
    James Belshan, Aug 13, 2004
    #5
  6. sreein78

    sreein78 Guest

    Thanks a lot James & Jorge,

    James, where can I find the code samples that you have mentioned?

    I would be extremely grateful if you could help me with the point-line distance functions.

    Thanks and best regards,

    Sree
     
    sreein78, Aug 15, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.