Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/10/2024 in all areas

  1. @Steven P, so NOTEPAD demand more from the user, I use VLIDE since my first LSP, and debug is easiest, and I can run line by line to test it.
    1 point
  2. @Steven P, Why not VLI DE?
    1 point
  3. We have Custom.lin, MCC-Services.lin, DRAINPIPE.LIN, plus more custom linetypes. Just type "linetype" and look it shows what is loaded, select another file and can choose "TRAZOS". Side note yes can load linetype "TRAZOS" from a custom.lin file if its not already loaded. (defun loadLinetype (doc LineTypeName FileName) (if (and (not (existLinetype doc LineTypeName)) (vl-catch-all-error-p (vl-catch-all-apply 'vla-load (list (vla-get-Linetypes doc) LineTypeName FileName ) ) ) ) nil T ) ) (defun existLinetype (doc LineTypeName / item loaded) (vlax-for item (vla-get-linetypes doc) (if (= (strcase (vla-get-name item)) (strcase LineTypeName)) (setq loaded T) ) ) ) (setq doc (vla-get-activedocument (vlax-get-acad-object))) ; open database ;load missing linetypes ;;; returns: T if loaded else nil (loadLinetype doc "Fence" "custom.lin") (loadLinetype doc "Tree" "custom.lin")
    1 point
  4. This usually gets me in trouble now since im not using lisp on a daily basis anymore. I suggest notepad++ recognizes lisp code structure so things are color coded and its easier to hunt down errors. if you want to go off the deep end get Visual stuido Code. doe everything notpad++ does and alot more like specific addins and autocomplete syntax. if you have BrisCAD 18 or higher they have a build in coder called blade.
    1 point
  5. I think most of us started with an idea "How do I do this quicker, more accurately or more consistently" and start from there, building up knowledge as you create LISPs to do what you want to do. I use a lot of online resources, this forum is great by the way. For learning don't ask for a complete LISP since you are likely just to save that and not learn how it does what it does, but ask for small portions of code. Use these codes in your projects Apart from here, there is another forum, TheSwamp which is also good. Online: AfraLisp has a lot of good examples, Lee Mac has a lot of small functions which can be used to build larger functions or as stand alone functions AutoDesk has online help for all the functions As for creating a LISP, it is a text based language and you can use any simple text editor to write the code as the simplest form First off though I'd look on Lee Macs website for his tutorials on writing and running LISPs
    1 point
  6. If you look at the bottom of the page you linked to, there's some code that calls minboundingbox. The word sel refers to a variable that's defined earlier in the function, and that comes from a selection made by the user. So you can either create a function that calls minboundingbox, which you'll be able to use whenever you need it, or rewrite the freestanding command to call ssget as shown in Lee Mac's example. If you need more help, ask away. Welcome to the forum!
    1 point
  7. Usually fonts follow the same chr # but different languages or a custom font might not be the right number you can use this to find the corrrect # ;;----------------------------------------------------------------------------;; ;; Output Character ASCii number table (defun C:text_table (/ vars vals base i c tx base_n) (setq vars '(snapmode osmode cmdecho ATTDIA ATTREQ LUPREC) ;list of variables vals (mapcar 'getvar vars) ;store old values ) (mapcar 'setvar vars '(0 0 0 0 1 0)) ;set new values (setq base (getpoint "\nEnter Starting Point :") i 0 c 0 n (/ (getvar 'textsize) 8) H (getvar 'textsize) ) (while (< i 1000) (setq tx (strcat (AT:NumFix (itoa i) 4) " = " (chr i)) base_n (list (+ (car base) (* (fix (* (/ c 25) n)) 100)) (- (cadr base) (* 20 (* c n)))) ) (entmake (list '(0 . "TEXT") (cons 8 (getvar 'clayer)) (cons 10 base_n) (cons 40 H) (cons 1 tx) (cons 7 (getvar 'textstyle)) ) ) (setq i (1+ i)) (setq c (1+ c)) (if (eq c 25) ;simple counter to step over (progn (setq base (polar base 0 3)) (setq c 0) ) ) ) (mapcar 'setvar vars vals) ;restore old values (princ) ) (defun AT:NumFix (s n) ;; Fix number string with leading zeros ;; s - Number string to fix ;; n - Number of characters for final string ;; Alan J. Thompson, 10.29.09 ;; (AT:NumFix i 3) i= 1 = 001 (if (< (strlen s) n) (AT:NumFix (strcat "0" s) n) s ) )
    1 point
  8. This is what I use: (vlax-invoke-method <Workbook Object> 'saveas <Filename> 51 "" "" :vlax-false :vlax-false 1 1) Reference: https://docs.microsoft.com/en-us/office/vba/api/excel.workbook.saveas
    1 point
  9. Hi Please could someone assist with modifying an existing routine that moves a nested entity (NestedMoveV1-2.lsp by Lee Mac). This is an awesome routine, and I have looked into the code, but unfortunately I am still too new to LISP to make any progress. If someone could perhaps show me how to modify the routine to do the following , I would really appreciate it: 1. Enable the entity being moved to be visually "dragged" with the cursor (perhaps this has somehting to to with DRAGMODE system variable?) - this would enable me to accurately place the entity in the new position while taking into account any adjacent objects in the drawing. 2. Is it possible to have this work with dynamic blocks as well? Looking forward to your replies NestedMoveV1-2.lsp
    1 point
×
×
  • Create New...