Anis Posted December 23, 2020 Posted December 23, 2020 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 Quote
BIGAL Posted December 24, 2020 Posted December 24, 2020 This has been answered before I think it was over at forums/autodesk it was not referred to as road cross section areas. Will try to find. Quote
Anis Posted December 29, 2020 Author Posted December 29, 2020 Dear BIGAL thanks for reply. unfortunately i couldn't find the one you said. would you please find it for me?! Quote
tombu Posted December 29, 2020 Posted December 29, 2020 Two links from about 585,000 results from Google: https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/hatch-between-two-lines/td-p/816553 Quote
BIGAL Posted December 29, 2020 Posted December 29, 2020 (edited) 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 December 29, 2020 by BIGAL Quote
Anis Posted December 30, 2020 Author Posted December 30, 2020 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 metnx cutandfil rev 2.0.LSP Quote
old fish Posted December 31, 2020 Posted December 31, 2020 (edited) 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 December 31, 2020 by old fish Quote
marko_ribar Posted December 31, 2020 Posted December 31, 2020 (edited) old fish, I believe all your routines are flawless without any subs... Or it's just me drinking beer... Edited December 31, 2020 by marko_ribar Quote
BIGAL Posted December 31, 2020 Posted December 31, 2020 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. 1 Quote
Recommended Posts
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.