Results 1 to 1 of 1

Thread: Drawing Pipes in Cross Sections

  1. #1
    Administrator BlackBox's Avatar
    Join Date
    Login to Give a bone

    Default Drawing Pipes in Cross Sections

    I couldn't find what I'm looking for searching through the forums. If you know of something I've missed, please feel free to point me in the right direction, so I can do some leg work myself.

    Platform Used: AutoCAD C3D 2009 Land Desktop Companion (LDC)

    I already have a routine that gathers station/offset information from the project alignment (in plan view), which translates into the offset of a line object in the cross section (previously selected). The line object is a construction line drawn prior to the routine running, and centered on all cross sections.

    I can programmatically select a cross section by point using this, as part of my larger routine:

    ;; Extracted from CUI
      (zz_sdsk '(ad_xsutl 1))           ; Load ldd cmd,
      (c:LDD)                           ; Select section by point.
    What I need help doing programmatically is this:

    1. Determine the station of the section selected (i.e., 586+00.00)
    • I’ve determined that using LDD command to select by point, ENTLAST is not the xs_def2 block desired. Thus I cannot pull the station information from the ENTLAST entity name’s attribute data.
    • Another issue identified, apparently the “Station” attribute data listed within the xs_def2 block does not match the listed current section. (i.e., you select station by point and the command line returns “Current Section 595+12.34,” whereas the station property of the xs_def2 block that is associated with said section reads “59511.231342”… no matchy.
    • There’s got to be a way to extract the current section (i.e., current station) from the data base, no?
    2. Once the current section has been stored to a local variable (in theory), I can determine the datum elevation (i.e., 15.00), and insertion point of the xs_def2 block itself:

    (defun c:TEST (/ obj1 eName eData sectionStation sectionDatum 
    ;|  Using entsel here in lieu of the missing programmatic 
    selection mentioned above.  |;
    (setq obj1 (entsel))
    ;|  Note - Relying on selection of this block is not a sustainable option, 
    as this block is only visible when “attmode” = 2.
    Instead, I would like to create a selection set from the extracted
    section value. (i.e., (ssget "x" '((1 . [ExtractedSectionValueHere])))
    If there’s a better method, I am open to suggestions!!!  |;
    (setq eName (car obj1))
    ;|  No idea why this does not work...?
    It works on some of my other routines just fine.
    (/= (cdr (assoc 0 eData)) "ATTRIB")
    (/= (cdr (assoc 2 eData)) "STATION"))  
    (setq eName (entnext eName))
    (setq eData (entget eName))))
    Instead of returning the “Station” attdef, it returns the “Name”…?
    (= (cdr (assoc 0 eData)) "ATTRIB")
    (setq sectionStation (cdr (assoc 1 eData))))  |;
    (repeat   2
      (setq eName (entnext eName))
      (setq eData (entget eName)))
      (= (cdr (assoc 0 eData)) "ATTRIB")
       (setq sectionStation (cdr (assoc 1 eData))))
    (setq eName (car obj1))
    (repeat 14
      (setq eName (entnext eName))
      (setq eData (entget eName)))
      (= (cdr (assoc 0 eData)) "ATTRIB")
       (setq sectionDatum (cdr (assoc 1 eData))))
    (setq sectionInsert (cdr (assoc 10 (entget (car obj1)))))
    ;; Display results
    (prompt (strcat "\n Current Section = " sectionStation))
    (prompt (strcat "\n Datum = " sectionDatum))
    (prompt "\n Insertion = ")
    (princ sectionInsert)
    (princ)) ;_end defun
    If someone can help me get passed this roadblock, I pretty much have a clear idea of what code is necessary to permit the user to enter the necessary pipe data, thus drawing the pipe in the section (horizontally), based on the datum, and insertion point of the xs_def2 block (polar calculations adjusted for section scale).

    Once this is accomplished, I will make the attempt to proceed with prompting the user to specify a point within the profile (top of pipe, or invert), which may be used to then extract the vertical portion of this routine.

    Also worthy of note - this routine is primarily being used to draw the existing utilities in the cross section, as these are not done using pipeworks (at least not at my company). It's faster just to draw them manually (even without the routine I am attempting here), I'm simply trying to automate the process already in use today. Currently, this task is usually done with the given that the user has three viewports: Cross Section, Plan, and Profile views.

    Last edited by RenderMan; 2010-05-01 at 07:45 PM. Reason: Clarity
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3630, Core i9-9900K 5.0GHz, 128GB RAM, Samsung 970 Pro M.2, 8GB NVIDIA Quadro P4000

Similar Threads

  1. Yellow box displaying in Cross Sections drawing
    By Wish List System in forum Civil 3D Wish List
    Replies: 0
    Last Post: 2014-10-27, 03:22 PM
  2. Replies: 0
    Last Post: 2011-10-24, 04:07 PM
  3. line breaks when pipes cross
    By timsea81 in forum Revit MEP - General
    Replies: 1
    Last Post: 2010-08-16, 11:05 PM
  4. pipes in cross sections - C3d 2008
    By tcapmusic in forum AutoCAD Civil 3D - Sections
    Replies: 2
    Last Post: 2009-07-01, 05:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts