Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/21/2023 in all areas

  1. I looked at the SetCurrent.lsp and, by analogy, added two lines of code after (setq entity...) to textcalculator.lsp. Thanks to this, the program sets the current font size to the same as the font size of the selected object. (defun _Select ( msg / entity num dtext mtext ) (while (progn (setvar 'ERRNO 0) (setq entity (car (nentsel msg))) (setq entbl (entget entity)) (setvar "TextSize" (cdr (assoc 40 entbl))) I hope LeeMac will forgive me.
    2 points
  2. (defun c:bn ( / e p xtext ) (vl-load-com) (if (and (setq e (ssget '((0 . "INSERT")))) (setq e (vlax-ename->vla-object (ssname e 0))) (setq p (getpoint "\n Specify Point for Text: ")) ) (progn (setq xtext (entmakex (list (cons 0 "TEXT") (cons 100 "AcDbEntity") (cons 100 "AcDbText") (cons 10 (trans p 1 2)) (cons 1 (vlax-get-property e (if (vlax-property-available-p e 'effectivename) 'effectivename 'name))) (cons 50 (getvar 'VIEWTWIST)) (cons 41 1) (cons 51 0) (cons 71 0) (cons 72 1) (cons 11 (trans p 1 2)) (cons 100 "AcDbText") (cons 73 2)) ) ) ) ) (princ) ) how about like this ?
    2 points
  3. Ohhhh that's a fantastic feature. Why didn't I know about this before. Is there any limitations? This could open up a lot more automation in the work I do as well as others. Thanks for bringing this to my attention. I love these forums.
    1 point
  4. ldata in this instance is to cut down on mistakes. (opening a drawing at a later date) AutoCAD would remember the manufacture picked back when the command was run and automatically have it set to the default option. rather then always being "Brown" and potentially picking the wrong offset. You could also save the offset value as well.
    1 point
  5. Option selection is this part? (setq option (getstring prompt options '("R" "L" "C" "A"))) The getstring function is the wrong format, it should be (getstring [cr] [msg]) Where [cr] is T or nothing to allow the user to enter spaces (in the case of T) or if a space acts like a carriage return [msg] would be prompt in your example (https://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-B139EFBD-74B7-4276-B422-D2186F7D8D0A) If you want to use options look at initget as a line immediately before the getstring line - which should be replaced by getkword (http://docs.autodesk.com/ACD/2013/ENU/index.html?url=files/GUID-9ED8841B-5C1D-4B3F-9F3B-84A4408A6BBF.htm,topicNumber=d30e618800) (initget "R L C A") (getkword (strcat prompt)) and this from Lee Mac will test that you have selected a valid input: ;;https://www.cadtutor.net/forum/topic/6451-initget-amp-getkword/ (and (not (initget 1 "R L C A")) (setq option (getkword prompt)))
    1 point
  6. The LISP is working very well. I can't seem to get a script to run past creating the first .dwg, even not using the LISP. Pretty much tried a lot of ways, maybe I need to run a separate batch routine ( I have a VBA one that might be modified) to individually open drawings and run the script. ;;; This seems to work fine manually to create a .dwg and import a .sat I have tried several ways to Aarrange the script, even every line on a new row. ;;;ACIS (.sat) to .dwg Script;;; ;;;Open DWG Kill Dialog Box ACIS File to Convert ZOOM EXTENTS SAVEAS;;; FileDia 0 QNEW FileDia 0 ACISIN "H:\Blocks\3D Blocks\SAT Files\.5 FLAT WASHER FOR SOFT MATERIALS.SAT" ZOOM EXTENTS SAVEAS 2018 "H:\Blocks\3D Blocks\SAT-DWG\.5 FLAT WASHER FOR SOFT MATERIALS.SAT" Close QNEW FileDia 0 ACISIN "H:\Blocks\3D Blocks\SAT Files\.5 Flat Washer SAE.SAT" ZOOM EXTENTS SAVEAS 2018 "H:\Blocks\3D Blocks\SAT-DWG\.5 Flat Washer SAE.SAT" Close Here is my latest version of the LISP. I put separate lines hoping to get hard enters. ;;;*********************************************************************************************************************************;;; ;;; Generate a Script file for drawings in a folder mhupp-https://www.cadtutor.net/forum/topic/78123-batch-convert-acis-sat-to-dwg/ ;;; Adapted to create a script to create seperate drawings from ACIS (.sat) files by SLW210. ;;; Original Modification-08/15/2023 ;;;*********************************************************************************************************************************;;; (defun C:Gen-Script-ACISIN (/ Path UserFile BlkLst F1 FileName) (setq UserFile (getfiled "Choose a Folder to Process" (getvar 'DWGPREFIX) "*" 16 ) Path (vl-filename-directory UserFile) BlkLst (vl-directory-files Path "*.sat" 1) ;change extention to find dwg or dxf BlkLst (vl-remove (getvar 'DWGNAME) blkLst) ;if Active Drawing is in the same folder remove BlkLst (vl-sort blkLst '<) F (open (strcat (getenv "userprofile") "\\Documents\\ACISIN.scr") "w" ) ;Save script ) (if BlkLst (progn (foreach FileName BlkLst ;;;////////***Start adding lines and commands for the script here***\\\\\\\\;;; (write-line "Filedia" F) (write-line "0" F) ;FileDia = 0 (write-line "qnew" F) ;Open new drawing (write-line "Filedia" F) (write-line "0" F) ;FileDia = 0 (write-line (strcat "_.ACISIN \"" Path "\\" FileName "\"")F) ;Import .sat (ACIS) files (write-line "Zoom" F) (write-line "Extents" F) ;Zoom Extents (write-line (strcat "_.saveas "" \"" Path "\\" FileName "\"") F) ;SaveAs with same folder and name.dwg (write-line "Close" F) ;Close the drawing ) ) (prompt "\nNo Files Found in Folder") ) (close F) (prompt (strcat "\nScript File for " (itoa (length BlkLst)) ;write the script " Files Created" ) ) (if (= (ACET-UI-MESSAGE "Do you Want to run the Script Now?" "User Input" (+ Acet:YESNO Acet:ICONWARNING))6) ;Yes (vl-cmdf "_.Script" (strcat (getenv "userprofile") "\\Documents\\ACISIN.scr") ) ) (princ) ) I must be doing something wrong, I get on the commandline for drawing I start the script in... Command: Filedia Enter new value for FILEDIA <1>: 0 Command: qnew Command: Regenerating model. Command: The commandline for the newly opened drawing... Command: Command: Command: Command: 0 Unknown command "0". Press F1 for help. Command: Regenerating model. Command:
    1 point
  7. (cons 7 (getvar 'TEXTSTYLE)) This is only pulling the current text style "name". Don't really know how to pull the justification of the current text style but you need to add (con 71 #) 1-9 more here. http://docs.autodesk.com/ACD/2011/ENU/filesDXF/WS1a9193826455f5ff18cb41610ec0a2e719-79f8.htm
    1 point
  8. problem has already been solved by the comments above, but I tried changing png to 24bit bmp in Windows Painter and using the bmp to polyline routine I wrote before. (Input 255, 255, 255, 30% in exclusion color, keep true color) left : true color, right : aci color for ctb In this case, there is already a gradient hatch on the CAD so there is no need to perform this additional process. but this routine can be applied to any image and it doesn't matter what shape it is Drawing2.dwg
    1 point
×
×
  • Create New...