Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/05/2022 in all areas

  1. I tried changing SECUREREMOTEACCESS variable, doesn't change anything. And the photos are all from the same source. It must be the length limitation, because I downloaded the same photo and added just one by one "&" symbol to link until it length was over 285, and then I got an error. Don't think it can be done with Vla-GetRemoteFile, unless the length limit can be somehow changed. Also I found a thread with the same problem, and length of not working link is 286...unfortunately no solution was posted https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-getremotefile-automation-error-inet-not-a-valid-url/td-p/1299507
    2 points
  2. Call Grind for Lisp (CG) is a Lisp application aimed to help profiling of lisp programs running on IntelliCAD, AutoCAD, BricsCAD and alikes. If you are in need of determining the bottle-necks, the time consumed for specified functions , visualize call diagram of your lisp application you may find CG useful. CG collects data (time consumed by each function and call stack) at runtime (dynamic analysis) and creates “call grind” type output to be used by CacheGrind system (credit goes to authors). Requirement: Download and install qcachegrind software recompiled for Windows version of KCacheGrind. Refer to header of the lisp code attached for instructions. Limitation: May fail in consecutive functions forming loop. License: Copy Left Enhanced the code, found a bug? Just let me know. Suha cg.lsp
    1 point
  3. The 'upgrade' to the forum software a few years ago caused every occurrence of "8)" within code blocks to be removed rendering many thousands of code posts unusable; I've now updated my earlier post to reinstate the missing characters.
    1 point
  4. @TemporaryCADGot it!!! (foreach b (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex s (setq x (- x 1)))))) THANKS!!! EDIT: that simple (setq x (- x 1)) even fixed the looping! I'm starting to believe!
    1 point
  5. This is not the case. the lisp is segmenting the url to create the file name. so anything after the last / is consider the file name. for that url its "jpeg&layers=gebco_latest&width=1200&height=600&version=1.3" You have to feed it url's that end with the file name like the example with the pdf BricsCAD ends up creating a 0 kb file tho.
    1 point
  6. Select text, select line, ok now the buggy part does offset go left or right ? If its always away from text then easy. (defun c:wow ( / ent off pt ent2 pt2) (setq ent (entget (car (entsel "\nPick text ")))) (setq off (atof (cdr (assoc 1 ent)))) (setq pt (cdr (assoc 10 ent))) (setq ent2 (entsel "\nPick line ")) (setq pt2 (cadr ent2)) (command "offset" off ent2 (polar pt2 (angle pt pt2) 10.0) "") ; increase 10 if problems dummy point ) (c:wow)
    1 point
  7. I use (ascii (getstring)) and I must have pressed colon ":" instead of semi colon ";" yes should be 59 I should have tested in Acad also thanks for correction changed code above.
    1 point
  8. BigAl, Nice idea, I would have gone for Lee Macs string to list, just because I know of that one and not the CSV to list I get the same as the OP, bad argument type. In the csv-.lst, does the '58' need to be 59, 58 is '':' in AutoCAD [EDITED THIS LINE] Oh, forgot to add, you need to put the ';' back in the text string as well - see below [EDITED THIS LINE] Using String to List: http://lee-mac.com/stringtolist.html - but the rest is yours: (defun LM:str->lst ( str del / pos ) (if (setq pos (vl-string-search del str)) (cons (substr str 1 pos) (LM:str->lst (substr str (+ pos 1 (strlen del))) del)) (list str) ) ) (defun c:wow ( / ss x att entname numinc newstr lst) (setq numinc (Getint "\nEnter increment or minus to be used ")) (setq entname (cdr (assoc 2 (entget (car (entsel "Pick 1 block for block name ")))))) (prompt "Select blocks") (setq ss (ssget (list (cons 0 "INSERT")(cons 2 entname)))) (repeat (setq x (sslength ss)) (setq att (car (vlax-invoke (vlax-ename->vla-object (ssname ss (setq x (1- x)))) 'Getattributes))) (setq str (vla-get-textstring att)) (if (= (wcmatch str "*;*") nil) (setq newstr (rtos (+ numinc (atoi str)) 2 0)) (progn (setq lst (LM:str->lst str ";")) ;; Slight change here (setq newnum (rtos (+ numinc (atoi (cadr lst))) 2 0)) (setq newstr (strcat (car lst) ";" newnum)) ;; ADD BACK IN THE SEMICOLON HERE ) ) (vla-put-textstring att newstr) ) (princ) )
    1 point
  9. Best way to learn is by having a go.... Taking it step by step then, start by making a LISP file - you should be able to do that and copy this into it which will allow you t select text and get the value, then can take the next step and you'll learn as you go along: (defUn c:test ( / Mytext MyTextVal ) ;;define the LISP routine. After the / are local variables used only in this LISP (princ "Select Text") ;; princ - puts a message in the command line (setq MyText (entget (ssname (ssget "_+.:E:S" '((0 . "TEXT"))) 0))) ;; Select a selection, the other parts linit this here to 1 tect object (setq MyTextVal (cdr (assoc 1 MyText))) ;; get the text from the selected text above MyTextVal ;;returns the text value from this LISP ) ;; end the routine See if this works for you then can do the next step
    1 point
  10. You may want to consider my Total Length & Area programs. To modify the precision of the output, change: (princ (rtos a 2)) To: (princ (rtos a 2 15)) Alternatively, retain the existing code and increase the value of your LUPREC system variable.
    1 point
×
×
  • Create New...