Jump to content

Flow Arrow Direction LISP


sadamitis

Recommended Posts

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 Arrows.jpg

Flow Arrow.dwg

Link to comment
Share on other sites

  • Replies 26
  • Created
  • Last Reply

Top Posters In This Topic

  • devitg

    10

  • sadamitis

    8

  • Adi_Putra

    5

  • guigonse

    3

Top Posters In This Topic

Posted Images

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!!

Link to comment
Share on other sites

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)

)

)

 

 

)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

?

Link to comment
Share on other sites

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,

 

AF1QipOKCdJnR2PL46lMzNnwPcyNfV9xIjj_jVcTDusf

 

AF1QipPXnmyTl6t2t-19f0HkQhgJ8nJWWOu4ucbTk-aO

Link to comment
Share on other sites

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 by devitg
add question
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...