So the first line of text represents the length of the each segment of the polyline ? and the two lines of texts should be imported from the txt file ?
Since the last two lines of texts are the same, why don't we just add them immediately to the oncoming program without bothering users to select that txt file? unless you have different information for each process.
It is not a good way to write diameter symbol via ZERO number crossed with a line, you can just include these three chars like this %%C
Have a look at the following image for more information:
What do you think about adding attributed block and place the block at the center of the two vertices as demonstrated in the following video?
http://giphy.com/gifs/l2SpMxoitccEAhV9S Tharwat,
I didn't understood question. First line, you probably meant column, or vertical line. Yes, first column is length of segment.
PVC SN8 is type of material and it is always the same (in 99%), 218 (fourth line) is diameter of pipe profile and it is different for each pipeline, last line is slope, and as you can see it is different for each pipeline (it even changes within one pipeline).
Solution you have presented in .gif is great, just missing "L=" prefix on length label. Can you explain me bit more, or walk me thru the process?
Thank you Here is the draft codes for you to test and let me know what are the needed changes for a complete program.
NOTE: the following drawing has the Attributed Block entitled [ labeling Block ] and it should be in any drawing you want to run the program with.
Test.dwg
label.LSP This is good, only problem is slopes are constantly 0.6% (while in the file they vary between 1 and 0.6, on longer pipelines they can have tens of different values) and pipe profile radius is also constant (in this case it is constant all the way, because it's short example, but on longer lines it changes 2-3 times).That is why I need text file for labelling.
This lisp you have attached will be very useful, as tertiary Network (more then hundred km's) will be done with constant slopes and pipe radiuses. I'm just going to need to be prompted for slope and radius which will be used, but I'll try to modify it by myself. Is the number 218 represents the radius ? Yes, in millimetres Okay, were you able to modify the program or you need me to modify it for you? To label from slopes and radiuses from text? No, I haven't.
I can use this lisp for tertiary network (as I mentioned), and that's great piece of work (more the a 1/3). I just need to be prompted for slope and radius input.
Still, for primary and secondary I need slopes and radiuses from file. Keep the file aside at the mean time for the second job and let us finish your current project with that tertiary Network.
So if this tertiary work needs to change the radius & Slope value here is the final program, try it and let me know.
NOTE: I just changed the way to select polyline so with this program you can select as much of polylines as you want.
(defun c:Test (/ *error* s i e atts sp sty lay l p bk lst ang) ;; Tharwat - Date: 11.Aug.2016 ;; (defun *error* (msg) (if atts (mapcar 'setvar '(ATTREQ ATTDIA) atts) ) (and msg (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*EXIT*")) (princ (strcat "\nError => " msg)) ) (princ) ) (if (and (if (tblsearch "BLOCK" "Labeling Block") t (progn (alert "Attributed Block nameis not found in drawing !" ) nil ) ) (setq *LabRadii* (cond ((getint (strcat "\nSpecify radius " (if *LabRadii* (strcat " :") ":" ) ) ) ) (*LabRadii*) ) ) (setq *LabSlope* (cond ((getreal (strcat "\nSpecify Slope " (if *LabSlope* (strcat " :") ":" ) ) ) ) (*LabSlope*) ) ) (princ "\nSelect polylines to label :") (setq s (ssget "_:L" '((0 . "POLYLINE")))) ) (progn (setq atts (mapcar 'getvar '(ATTREQ ATTDIA)) sp (vlax-get (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object)) ) 'Block ) sty(if (tblsearch "STYLE" "tablicni") "tablicni" "Standard" ) lay(if (tblsearch "LAYER" "FRONTOVI") "FRONTOVI" (getvar 'CLAYER) ) ) (mapcar 'setvar '(ATTREQ ATTDIA) '(1 0)) (repeat (setq i (sslength s)) (setq e (ssname s (setq i (1- i)))) (while (and (setq e (entnext e)) (= "VERTEX" (cdr (assoc 0 (setq l (entget e))))) (setq lst (cons (cdr (assoc 10 l)) lst)) ) ) (repeat (1- (length lst)) (setq p(mapcar '(lambda (j k) (/ (+ j k) 2.)) (car lst) (cadr lst) ) ang (angle (car lst) (cadr lst)) bk (vla-insertblock sp (vlax-3d-point p) "Labeling Block" 1.0 1.0 1.0 (if (and (> ang (* pi 0.5)) (
页:
1
[2]