Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/26/2023 in all areas

  1. Here is an simple alternate method using an "acet" Express Tools function from the arx. Note: Express Tools must be installed. (defun C:CBP (/ bp en p2 ss) (if (not (acet-util-ver)) (arxload "acetutil.arx" (progn (princ "\nExpress Tools Failed to Load. Program Aborted.") (exit) ) ) ) (if (and (progn (princ "\nSelect Objects to Copy: ")(setq ss (ssget))) (setq bp (getpoint "\nSelect Base Point of Displacement: ")) ) (progn (command "copybase" bp ss "") (while (setq p2 (acet-ss-drag-move ss bp "\nSelect Second Point of Displacement: " T)) (command "pasteclip" p2) ) ) ) (princ) )
    1 point
  2. Just a note of caution that if it exists in a drawing it can be copied. For example, with deter I think there is a LISP undeter out there, sounds familiar anyway, if you know what was used to protect the file. I am guessing - though might be wrong - that you want to protect your work and information but need to send your clients a dwg... but don't want them to copy it? If the clients don't specify dwgs then you could send them raster PDFs (up to date AutoCAD will produce vector PDFs by default). You could protect the drawing contractually but once copied the information is out there to use though. It isn't anything I have ever had to do though, current work if the client pays for DWGs, that is what they get otherwise PDFs, but end of the day they pay so they can have them. Before working for an owner we had control of all the drawings, never went out the office. Never worked for a manufacturer but looking at manufacturers drawings they often only include the important information such as an overall dimension, connection points or whatever. There was this link here which goes through protecting PDFs a little, maybe some of these ideas might help:
    1 point
  3. Thanks for the reply, I will look into it. The problem is that, I need to give the code only the name of the block, so that it will find the first empty attribute and start filling the information initially given to it. I apologize for my English. My level is beginner(AutoLisp).
    1 point
  4. What are your skills with LISP like? I often ask this to anyone with a few posts - and knowing this we can give a better answer. For example, do you just need a quick hint or a link and you can work out the rest or anything between to needing the full solution, the forums can generally help whichever way. I'll post a link, see http://www.lee-mac.com/attributefunctions.html who details how to read attributes, get a list of attributes and set attributes, I think the basis of a LISP is all in there. If I get chance later today I'll put them all together for you
    1 point
  5. (defun c:TH2 (/ ss pnt) (while (setq ss (ssget ":L" '((0 . "TEXT") ))) ;Selects only text on unlocked layers (foreach txt (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) (setq pnt (trans (cdr (assoc 10 (entget txt))) 0 1)) (setpropertyvalue txt "Height" 2) (setpropertyvalue txt "WIDTHFACTOR" 0.8) ; ADD THIS LINE ) ) (princ) ) And for another routine (vlax-put-property obj 'height 2) ; Set the height value to 2 in this obj. (vlax-put-property obj 'WIDTHFACTOR 0.8) ; Set the WIDTH value to .8 in this obj. <<<< ADD THIS LINE
    1 point
  6. Ignoring do something on each one. Save as a script file .scr open "C:\\Users\\User\\file01.dwg" open "C:\\Users\\User\\file02.dwg" open "C:\\Users\\User\\file03.dwg" open "C:\\Users\\User\\file04.dwg" Lots of ways to write a script like this, google Lee-Mac script.
    1 point
  7. think simplest way would be : (defun c:test ( / docslist) (setq docslist (list "C:\\Users\\User\\file01.dwg" "C:\\Users\\User\\file02.dwg" "C:\\Users\\User\\file03.dwg" "C:\\Users\\User\\file04.dwg" )) (foreach doc docslist (ShellOpen doc)) (princ) ) ; returns T if no errors occurred during program execution (defun ShellOpen ( $f / it sh ) (if (and (not (null $f)) (setq $f (findfile $f)) (setq sh (vla-getInterfaceObject (vlax-get-acad-object) "Shell.Application"))) (progn (setq it (vl-catch-all-apply 'vlax-invoke (list sh 'open $f)))(vlax-release-object sh)(not (vl-catch-all-error-p it))) (progn (prompt "\nShell application was unable to open file")(setq it nil))))
    1 point
×
×
  • Create New...