Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/28/2023 in all areas

  1. This isn't a place to post and ask users to reverse engineer someone else's code. Contact the person who uploaded the video.
    2 points
  2. mAssoc here from Lee Mac in the link below will give you the vertices (coordinates) of a PolyLine. The second link below shows how to write to a text file. Mash the 2 together and off you go! And very quickly something like this: (defun c:test ( / ) (defun mAssoc ( key lst ) ;; Sub function to get the coordinates (foreach x lst (if (= key (car x)) (setq l (cons (cdr x) l)) ) ) (reverse l) ) ; end sub function (setq MyPLine (entget (car (entsel "Select Polyline")))) ;; select an entity. No error checking that polyline is selected though (setq Coords (mAssoc 10 MyPline) ) ;; sun the sub funciotn above, selected line and description '10' for coordinates (setq file (open [filePath and Name] "w")) ;; open text file, you put in the file name and file path (foreach n Coords ; a foreach loop each coordiante (write-line "101" file) ;; change this if you need different numbers ;; writing to the text file (write-line (car n) file) (write-line (cadr n) file) (write-line "100.000" file) (write-line "p" file) ) ; end foreach (close file) ;; cloe the text file (princ) ;; exit silently ) (though it is the weekend here, I turned CAD off a couple of hours ago now, so unchecked, there might be an odd typo in there, but you should get the idea) https://www.afralisp.net/autolisp/tutorials/file-handling.php
    1 point
  3. vl-string-subst can take string value only, so you have to change this (vl-string-subst "|" "." distance-final) like this (vl-string-subst "|" "." (vl-princ-to-string distance-final)) or (setq distance-final (atof (rtos scaled-distance 2 3))) to (setq distance-final (rtos scaled-distance 2 3)) like above comments way because you use (command ~~ that don't care it's not a numeric value.
    1 point
  4. This was an example, I thought it was simple for you to interpret this one and modify it accordingly. Without knowing your lisps, then maybe like this? (defun c:FOO ( / ) (if (not (c:xx)) (load "xx.lsp")) (if (not (c:yy)) (load "yy.lsp")) (mapcar '(lambda (x) (cond ((and (not (zerop (atoi x))) (eq (atof x) (atoi x))) (if (zerop (rem (atoi x) 2)) (c:xx) (c:yy) ) ) (T (princ (strcat "\nThe layout \"" x "\" have not name with interger or is null"))) ) ) (layoutlist) ) (textscr) (prin1) )
    1 point
  5. Try Exceeds with this small change (not fully checked but it should work): From: (if (= (len (atoi cl)) (len (itoa (atoi cl)))) ; check if the layout string is numeric. To: (if (= CL (itoa (atoi CL))) ; check if the layout string is numeric.
    1 point
  6. Try this ! (defun c:FOO ( / ) (mapcar '(lambda (x) (cond ((and (not (zerop (atoi x))) (eq (atof x) (atoi x))) (if (zerop (rem (atoi x) 2)) (princ (strcat "\n\"" x "\" is even (run your \"xx.lsp\")")) (princ (strcat "\n\"" x "\" is odd (run your \"yy.lsp\")")) ) ) (T (princ (strcat "\nThe layout \"" x "\" have not name with interger or is null"))) ) ) (layoutlist) ) (textscr) (prin1) )
    1 point
  7. (defun c:FOO ( / ll cl ) ; command is FOO (setq ll (layoutlist)) ; save layoutlist to ll list. (repeat (length ll) ; repeat as many time as number of members in the list ll. (setq cl (car ll)) ; get the first member of the list ll. (setvar 'ctab cl) ; set the current layout with cl. (if (= (len (atoi cl)) (len (itoa (atoi cl)))) ; check if the layout string is numeric. (progn ; if numeric (cond ; cond for determining odd even ((= (rem (atoi cl) 2) 0) ; if even (xx) ; run xx, if xx.lsp's command is xx and already loaded ) ; end of even ((= (rem (atoi cl) 2) 1) ; if odd (yy) ; run yy, if yy.lsp's command is yy and already loaded ) ; end of odd ) ; end of cond ) ; end of if numeric progn (progn ; if layout name is not numeric ) ; end of if not numeric progn ) ; end of if (setq ll (cdr ll)) ; Remove the first member of the list to move on to the next layout. ) ; end of repeat (princ) ; for mute parrot ) ; end of defun ================= Steven gave a nice comment. Adding this would also be a way. (vl-load-com) (defun len ( txt / ) (strlen (vl-princ-to-string txt)) )
    1 point
  8. I sent you (Adrian) a private message yesterday which included a way to contact me via email. Did you view it?
    1 point
  9. Well, let's see. I started out at a consulting environmental firm working on wastewater pumping stations, sanitary sewers and force mains. Then I was lured away by a specialty chemical company that was a client of ours. My primary focus was process piping and instrumentation diagrams, process flow diagrams and block diagrams. I also created a multi-use site pan depicting all underground utilities, individual building layouts of plant process buildings, tank farms, research facilities, offices and warehouses. I drew electrical schematics for the electrical department and structural drawings for the welding department. And then there was all the 3D work I did. Everything from additions to existing buildings, to reactors, storage tanks, loading arms, platforms, stairs, handrails, and various structural steel supports. I'm sure I forgot a few things but that's the bulk of it. I have worked in the fields of civil, structural, highway design, hydro-geologic, industrial and municipal wastewater treatment, electrical and architectural at one time or another.
    1 point
×
×
  • Create New...