sadamitis Posted August 18, 2017 Posted August 18, 2017 Hello and thank you for coming to see this! I am trying to create a LISP for placing flow arrows on contour lines with a known elevation. We just need the flow arrows on the contours to be perpendicular to the known elevations. We are trying to place them on the every 5’ interval line. The polylines have a known z value elevation I hope this helps. Please help I have uploaded an image and the CAD file so if you have any questions please let me know and once again thank you for viewing this! Flow Arrow.dwg Quote
devitg Posted August 18, 2017 Posted August 18, 2017 (edited) The arrow shall be a block . I will make it so Please clear about the 5´ distance . Edited August 18, 2017 by devitg add question Quote
sadamitis Posted August 19, 2017 Author Posted August 19, 2017 The flow arrows should be spaced roughly every 5-10 feet we are not looking for a million flow arrows just enough to show the difference in flow direction through out the project area. We are going to need to do these flows on mutilple different project so having this LISP would be extremely helpful!! Hope this helps!! Quote
devitg Posted August 20, 2017 Posted August 20, 2017 You need a block as arrow on your dwg arrow-each-five.LSP arrow-01.dwg Quote
sadamitis Posted August 21, 2017 Author Posted August 21, 2017 thank you so much i am going to see if this works! Quote
sadamitis Posted August 21, 2017 Author Posted August 21, 2017 What is the command to run the application? Quote
sadamitis Posted August 21, 2017 Author Posted August 21, 2017 Got the command to run its giving me this statement: FLOW pick the contour line ; error: no function definition: G-LENGTH here is the code: ;;; Command name is FLOW (DEFUN C:FLOW (/ ALL-CURVE-SS CURVE-LIST SAMPLE-CURVE SAMPLE-ENT SAMPLE-LAYER) (VL-LOAD-COM) ;;;(init-VL) (SETQ SAMPLE-CURVE (CAR (ENTSEL "pick the contour line "))) (SETQ SAMPLE-LAYER (CDR (ASSOC 8 (ENTGET SAMPLE-CURVE)))) (SETQ SAMPLE-ENT (CDR (ASSOC 0 (ENTGET SAMPLE-CURVE)))) (SETQ ALL-CURVE-SS (SSGET "X" (LIST (CONS 8 SAMPLE-LAYER) (CONS 0 SAMPLE-ENT)))) (SETQ CURVE-LIST (VL-REMOVE-IF-NOT '(LAMBDA (X) (= (TYPE X) 'ENAME)) (MAPCAR 'CADR (SSNAMEX ALL-CURVE-SS)))) ;;; (setq curve (nth 4 curve-list)) (FOREACH CURVE CURVE-LIST (IF (> (G-LENGTH CURVE) 60) (VL-CMDF "measure" CURVE "B" "arrow-01" "Y" 60) ) ) ) Quote
SLW210 Posted August 21, 2017 Posted August 21, 2017 Please read the Code Posting Guidelines and edit your Code to be included in Code Tags.[NOPARSE] Your Code Here[/NOPARSE] = Your Code Here Quote
devitg Posted August 21, 2017 Posted August 21, 2017 Sorry , fixed . You have to learn LISP , at least the basics. I change G-LENGTH, by (vla-get-Length(vlax-ename->vla-object CURVE)) Here it is ;-------------------------------------------------------------------------------------;; Design by Gabo CALOS DE VIT from CORDOBA ARGENTINA ;;; Copyleft 1995-2017 by Gabriel Calos De Vit ;; DEVITG@GMAIL.COM ;; Hecho por Gabo CALOS DE VIT de CORDOBA ARGENTINA ;;; Copyleft 1995-2017 por Gabriel Calos De Vit ;; DEVITG@GMAIL.COM (DEFUN C:FLOW (/ ALL-CURVE-SS CURVE-LIST SAMPLE-CURVE SAMPLE-ENT SAMPLE-LAYER) (VL-LOAD-COM) (SETQ SAMPLE-CURVE (CAR (ENTSEL "/n pick the contour line "))) (SETQ SAMPLE-LAYER (CDR (ASSOC 8 (ENTGET SAMPLE-CURVE)))) (SETQ SAMPLE-ENT (CDR (ASSOC 0 (ENTGET SAMPLE-CURVE)))) (SETQ ALL-CURVE-SS (SSGET "X" (LIST (CONS 8 SAMPLE-LAYER) (CONS 0 SAMPLE-ENT)))) (SETQ CURVE-LIST (VL-REMOVE-IF-NOT '(LAMBDA (X) (= (TYPE X) 'ENAME)) (MAPCAR 'CADR (SSNAMEX ALL-CURVE-SS)))) (FOREACH CURVE CURVE-LIST (IF (> (vla-get-Length(vlax-ename->vla-object CURVE)) 60); change 60 as need , 12 inch a feet (VL-CMDF "measure" CURVE "B" "arrow-01" "Y" 60) ) ) ) If need , edit the block to suit your need. Or change ,whatever. The not so perpendicular arrows, is due to the place where the arrow is located as it is located perpendicular to the curve at the point each 60 inch.The are located by the MEASURE acad command. Regards flow-arrow-each-five-00.LSP Quote
sadamitis Posted August 22, 2017 Author Posted August 22, 2017 Is there a way we can select multiple polylines so it all runs at the same time for all the lines rather than just one line? ? Quote
sadamitis Posted August 22, 2017 Author Posted August 22, 2017 its is also telling me that it can not find the block "measure"? sorry if i am being slow about this... Quote
Adi_Putra Posted August 26, 2017 Posted August 26, 2017 Good Morning, May I ask something about Autolisp, can you teach me how to create automatic arrow and text in polyline. I my case, I want make arrow edge heading opposite of my polyline. Also I want to give text in the middle of polyline. find attached file the picture that I meant. Thank you for your help, I wish get learn lot from this, Quote
Adi_Putra Posted August 26, 2017 Posted August 26, 2017 https://s20.postimg.org/ij8juwnnx/Before.png Quote
Adi_Putra Posted August 26, 2017 Posted August 26, 2017 https://s20.postimg.org/beqqlvgel/after.png Quote
devitg Posted August 26, 2017 Posted August 26, 2017 (edited) Please upload or give link to get the DWG in ACAD format , sad to say acad can not handle , by lisp or whatever , images , neither in LISP. By the way , what it text mean??? What is the short line at the poly mid point? Edited August 26, 2017 by devitg add question 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.