Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/04/2024 in all areas

  1. I'm not sure you can do that in a text editor, though you could edit the text, copy the selection to clipboard and use that snip of text as part of a find-replace type of function, with maybe (vl-string-subst new-str pattern str ). I think I know what you are meaning, not sure if it would be possible with DCL, create a pop-up box with the text string in a text box, highlight the selection required and click OK - something like that. Could use something like BigAls multi get vals to chose the bracket type in the same box.... but I am not sure how you would do the selecting text bit working
    1 point
  2. (strcat """f""") is read as@ (strcat "[open quote] "[close quote] "[open quote] f "[close quote] "[open quote] "[close quote]) - that is you are trying to join 3 text strings and 'f' is between quotes, so will be just the character f. " is a special character to define as here, the end of a text, but to use it as a part of the text you need to add a \ in front to tell CAD to use " as a letter (strcat "\"" f "\"" )
    1 point
  3. Curley brackets, have you looked at how they are? So create an mtext, type in some text and then use (assoc 1 (entget(car(entsel)))) to show how that text string is and that is what you should use/ For example, might be something like this: (1 . "123 \\{ asd \\} 456") (on the screen this displays are "123 { asd } 456"
    1 point
  4. Greeting! After some time of thinking (learning Lisp) and asking wrong questions, and something was lost in translation (sorry guys, thanks again), I “composed” this small program that solves my problem. Of course, thanks to Lee Mac and others for the finished functions! (defun C:TEST02 (/ ssTocke opcija opX noviBroj BrojInc pre suf kolikoTocaka ent tocka) ;--------------------------------------------------------------------------------------------- (defun LM:setattributevalue ( blk tag val / enx ) (if (and (setq blk (entnext blk)) (= "ATTRIB" (cdr (assoc 0 (setq enx (entget blk)))))) (if (= (strcase tag) (strcase (cdr (assoc 2 enx)))) (if (entmod (subst (cons 1 val) (assoc 1 (reverse enx)) enx)) (progn (entupd blk) val ) ) (LM:setattributevalue blk tag val) ) ) ) ;--------------------------------------------------------------------------------------------- (defun LM:getattributevalue ( blk tag / val enx ) (while (and (null val) (setq blk (entnext blk)) (= "ATTRIB" (cdr (assoc 0 (setq enx (entget blk))))) ) (if (= (strcase tag) (strcase (cdr (assoc 2 enx)))) (setq val (cdr (assoc 1 (reverse enx)))) ) ) ) ;---------------------------------------------------------------------------------------------- (defun extract (s / i prefix number suffix) (setq i 0 prefix "" number "" suffix "") (repeat (strlen s) (setq c (substr s (setq i (1+ i)) 1)) (cond ( (and (wcmatch c "#") (eq suffix "")) (setq number (strcat number c))) ( (and (wcmatch c "#*") (= suffix number "") (wcmatch (substr s (1+ i) 1) "#")) (setq number (strcat number c))) ( (eq number "") (setq prefix (strcat prefix c))) (t (setq suffix (strcat suffix c))))) (if (not (zerop (strlen number))) (setq pre prefix suf suffix) ) ) ;---------------------------------------------------------------------------------------------- (if (setq ssTocke (ssget "X" '((0 . "INSERT") (2 . "tocke")))) (progn (initget "Prve Zadnje") (setq opcija (getkword "\nPrenumerirajte tocke od [Prve/Zadnje] ubacene u crtez <Prve>: ") opcija (if opcija opcija "Prve") ) (initget 6) (or (setq noviBroj (getint "\nUpisite novi broj pocetne tocke <1>: ")) (setq noviBroj 1) ) (initget 6) (or (setq BrojInc (getint "\nUvecajte brojeve tocaka za <1>: ")) (setq BrojInc 1) ) (initget "Staro Novo Brojevi") (setq opX (getkword "\nPrefiks - Sufiks [ostavi Staro/upisi Novo/samo Brojevi] <Brojevi>: ") opX (if opX opX "Brojevi") ) (if (= opX "Novo") (progn (setq pre (getstring "\nUpisite prefiks ili <Enter> bez prefiksa: ")) (setq suf (getstring "\nUpisite sufiks ili <Enter> bez sufiksa: ")) ) ) (setq kolikoTocaka (itoa (sslength ssTocke))) (while (> (sslength ssTocke) 0) (if (= opcija "Prve") (setq ent (ssname ssTocke (- (sslength ssTocke) 1))) (setq ent (ssname ssTocke 0))) (if (= opX "Staro") (progn (setq tocka (LM:getattributevalue ent "TOCKA")) (extract tocka) ) ) (if (= opX "Brojevi") (LM:setattributevalue ent "TOCKA" (itoa noviBroj)) (LM:setattributevalue ent "TOCKA" (strcat pre (itoa noviBroj) suf))) (setq noviBroj (+ noviBroj BrojInc)) (ssdel ent ssTocke) );end while ) (progn (princ "Blok TOCKE nije pronaden, izlazim iz programa!") (exit) ) );end if (princ (strcat "\n...GOTOVO prenumerirano tocaka: " kolikoTocaka)) (princ) )
    1 point
  5. There has been a tool ever since Civil 3D was introduced in 2005. You will open the LDD drawing in C3D. Click on the Import tab. There is a Land Desktop button. You will then browse to the LDD database and it will import all the LDD items from the database.
    1 point
×
×
  • Create New...