Jump to content

Autolisp to hatch between two plines


Anis

Recommended Posts

Autolisp to hatch between two plines with different layers (layer1 and layer2 for example). When layer1 is above hatch the area in red, and when layer2 is above hatch in green. Actually I need this to calculate the area of cutt and fill in road cross sections

Link to comment
Share on other sites

tombu that is close but not the cross section answer like you will have to try to find it. The problem is they did not use "cross section" in their request but it was for volume calcs. It was more a hatch request, like "above below". I remember image has red and green hatching.

 

For Anis it may be like 2 months old solution maybe more and forums/autodesk gets lots of hits log in and scroll.

Edited by BIGAL
Link to comment
Share on other sites

Dear All;

Thanks for replying. I have tried the attached lisp but there is a problem that at this lisp i have to click all the cross sections one by one it would be more general if the code can select all green lines at ones and then the red lines. mean that, if there be 100 road cross sections for example; the code could select all cross sections and report a cut and fill file separately for each section (the same as AreaLabelV1-9.lsp of Mr.Lee Mac does)
I'm using this code, but i need to click on almost 2000 road cross sections one by one, indeed that is time consuming.
appreciate if anyone can help me
tnx

cutandfil rev 2.0.LSP

Link to comment
Share on other sites

Author: Zhang Haiping

(defun c:ttt (); 2020-12-30
    (if (and (setq ss (ssget '((0 . "LWPOLYLINE") (70 . 0))))
                (= (sslength ss) 2))
        (setq p1(xyp-Get-CurvePoint (setq e0 (ssname ss 0)) 0)
            p2(xyp-Get-CurvePoint e0 2)            
            p3(xyp-Get-CurvePoint (setq e1 (ssname ss 1)) 0)
            p4 (xyp-Get-CurvePoint e1 2)
            plst (list p3 p4)
            p3 (xyp-Get-PtNearPtn p1 plst)
            p4 (xyp-Get-PtNearPtn p2 plst)
            aa (xyp-line p1 p3)
            dd (xyp-line p2 p4) 
            ss (ssadd dd (ssadd aa ss))
            ww (xyp-Hatch-Solid (setq s1 (xyp-Get-Bpoly ss)))
            ee (XYP-ERASE (list s1 aa dd))
        )
    )
(princ)    
)

Edited by old fish
Link to comment
Share on other sites

old fish, I believe all your routines are flawless without any subs...

Or it's just me drinking beer...

🍺

Edited by marko_ribar
Link to comment
Share on other sites

The bottom line is invest in some civil software and volumes are just 1 function available, not only cut/ fill but individual pavement material volumes std in CSD.

 

Civ3d, Civil site design, others are out there. 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...