Jump to content

Leaderboard

  1. SLW210

    SLW210

    Moderator


    • Points

      4

    • Posts

      11,662


  2. BIGAL

    BIGAL

    Trusted Member


    • Points

      3

    • Posts

      20,141


  3. CyberAngel

    CyberAngel

    Trusted Member


    • Points

      1

    • Posts

      2,025


  4. Aftertouch

    Aftertouch

    Community Member


    • Points

      1

    • Posts

      477


Popular Content

Showing content with the highest reputation since 07/09/2026 in Posts

  1. Good suggestion @Koz, I thought you or one of the better LISPers here might throw out something. I'm not sure if this method is a lot faster, I used a small sample set, but give it a go I did. New territory for me. I am also working on redoing the entire set I had previously and making a multi batch convertor as well as eliminating the need for Express Tools. Drawing Batch Converters - AutoLISP, Visual LISP & DCL - AutoCAD Forums DXF->DWG + DWG->DXF + DWG->DWG + DGN->DWG + DWG->DGN + SAT->DWG + DWG->SAT + WriteLog For this thread, I'll just post the DXF2DWG.lsp. Works on my small sample set in AutoCAD 2026. ;;; Batch Convert a folder of DXFs to DWGs using DBX. | ;;; | ;;; https://www.cadtutor.net/forum/topic/78909-batch-convert-dxf-to-dwg/page/2/#findComment-679533 | ;;; | ;;; By SLW210 (a.k.a. Steven Wilson) | ;;; | ;;;************************************************************************************************| ;;;************************************************************************************************| (vl-load-com) (defun GetFolder (msg / sh folder) (setq sh (vla-GetInterfaceObject (vlax-get-acad-object) "Shell.Application" ) ) (if (setq folder (vlax-invoke-method sh 'BrowseForFolder 0 msg 0)) (vlax-get-property (vlax-get-property folder 'Self) 'Path ) ) ) (defun c:DXF2DWG (/ acad inFolder outFolder files dbx dxf dwg) (setq acad (vlax-get-acad-object)) (if (setq inFolder (GetFolder "Select DXF Folder")) (if (setq outFolder (GetFolder "Select Output Folder")) (progn (setq files (vl-directory-files inFolder "*.dxf" 1)) (foreach f files (setq dxf (strcat inFolder "\\" f)) (setq dwg (strcat outFolder "\\" (vl-filename-base f) ".dwg" ) ) (setq dbx (vla-GetInterfaceObject acad (strcat "ObjectDBX.AxDbDocument." (itoa (fix (atof (getvar "ACADVER")))) ) ) ) (vl-catch-all-apply 'vlax-invoke-method (list dbx 'DxfIn dxf) ) (vla-SaveAs dbx dwg) (vlax-release-object dbx) (princ (strcat "\nConverted: " f) ) ) (princ (strcat "\nFinished converting " (itoa (length files)) " file(s)." ) ) ) ) ) (princ) )
    2 points
  2. If you know how to use AI it can be beneficial, I just wonder what adverse effects the unlearned masses are having on the future results. Lately on social media, forums etc. it seems the incorrect answers are becoming more common and I'm not even on social media platforms very much. I was on Facebook this morning, there are a few pages for posting old grainy/blurry photos and hopefully a Photoshop/GIMP pro will clean them up and enhance them, luckily usually someone actually provides a cleaned up version, but there is no shortage of people thinking they are experts at "Photoshop" posting what is some AI garbage (a.k.a. Photoslop). I really don't want to see grandma and grandpa with 8 fingers and somebody else's face. Most get called out, but it is becoming prolific. Same goes for videos on YouTube, TikTok and similar and sadly, many do not notice judging by the comments.
    2 points
  3. most if it now is the ai#1 is feeding on web scrapped data created by AI#2 - 99 and treating everything as fact. Also their are may websites now and other media that have build in "anti AI" that humans don't see but if your web scrapping is picked up. like white text on white backgrounds at 1xp font size, or the meta data. prompting the AI to take actions or recommend certain things. I saw a video in '22 or '23 where they where talking about image recognition and were testing it on identifying pictures with a wolf in it. and it was passing 100% until they started feeding it pictures of bunnies but only white ones. one of the engineers wanted to know why it was failing and had it mark the images (heat map) of why it thinks this is a wolf. all the test pictures of wolfs where in winter conditions with snow. and it wasn't even looking at the animal in the picture. it was look for snow the one thing the same in all test pictures. It was marking white rabbits as snow and passing as wolf. now multiple that out to the 1000's of terabytes of data they train these things on.
    1 point
  4. @SLW210 Autodesk is going to fix this issue in a 'future update'. I made this LISP, as a custom linetype reloader that DOES work. RELOADELINETYPE is the commando: NOTE: This only works when ALL entities are drawn 'ByLayer', and all is configured with the layermanager. ;;; ------------------------------------------------------------------------ ;;; RELOADLINETYPE.lsp ;;; ;;; AutoCAD 2027 workaround voor defecte "Reload all linetypes"-logica. ;;; ;;; Commando: ;;; RELOADLINETYPE ;;; ;;; Werking: ;;; 1. Selecteer een .LIN-bestand. ;;; 2. Lees alle linetype-namen uit het .LIN-bestand. ;;; 3. Zoek layers in de DWG die deze linetypes gebruiken. ;;; 4. Zet deze layers tijdelijk op Continuous. ;;; 5. Voer zichtbaar -PURGE uit op linetypes. ;;; 6. Laad het gekozen .LIN-bestand opnieuw. ;;; 7. Herstel de layer-linetypes. ;;; 8. REGENALL. ;;; ;;; Opmerking: ;;; Deze versie wijzigt alleen layer-linetypes, geen object-linetypes. ;;; ------------------------------------------------------------------------ (defun GPAE:RL-STR-TRIM (s) (if s (vl-string-trim " \t\r\n" s) "" ) ) (defun GPAE:RL-CI-MEMBER (val lst / uval found item) (setq found nil) (if val (progn (setq uval (strcase val)) (foreach item lst (if (= uval (strcase item)) (setq found T) ) ) ) ) found ) (defun GPAE:RL-UNIQUE-CI (lst / result item) (setq result '()) (foreach item lst (if (not (GPAE:RL-CI-MEMBER item result)) (setq result (cons item result)) ) ) (reverse result) ) (defun GPAE:RL-READ-LINETYPE-NAMES-FROM-LIN (linFile / fh line clean commaPos name names firstChar) (setq names '()) (if (setq fh (open linFile "r")) (progn (while (setq line (read-line fh)) (setq clean (GPAE:RL-STR-TRIM line)) ;; Linetype-definitieregels beginnen met: ;; *NAAM,omschrijving ;; ;; Voorbeeld: ;; *DASHED,Dashed __ __ __ __ __ (if (> (strlen clean) 1) (progn (setq firstChar (substr clean 1 1)) (if (= firstChar "*") (progn (setq commaPos (vl-string-search "," clean)) (if commaPos (progn ;; vl-string-search is 0-based. ;; Bij "*ABC," geeft commaPos 4 terug. ;; substr is 1-based en lengte 3 geeft "ABC". (setq name (substr clean 2 (- commaPos 1))) (setq name (GPAE:RL-STR-TRIM name)) (if (> (strlen name) 0) (setq names (cons name names)) ) ) ) ) ) ) ) ) (close fh) ) ) (GPAE:RL-UNIQUE-CI names) ) (defun GPAE:RL-COLLECT-LAYERS-WITH-LINETYPES (doc ltNames / layers lay layerName layerLt result) (setq result '()) (setq layers (vla-get-Layers doc)) (vlax-for lay layers (setq layerName (vla-get-Name lay)) (setq layerLt (vla-get-Linetype lay)) (if (and layerLt (/= (strcase layerLt) "CONTINUOUS") (GPAE:RL-CI-MEMBER layerLt ltNames) ) (setq result (cons (list layerName layerLt) result)) ) ) (reverse result) ) (defun GPAE:RL-SET-LAYERS-CONTINUOUS (doc layerData / layers item layerName layObj) (setq layers (vla-get-Layers doc)) (foreach item layerData (setq layerName (car item)) (vl-catch-all-apply '(lambda () (setq layObj (vla-item layers layerName)) (vla-put-Linetype layObj "Continuous") ) ) ) ) (defun GPAE:RL-RESTORE-LAYER-LINETYPES (doc layerData / layers item layerName oldLt layObj failed) (setq layers (vla-get-Layers doc)) (setq failed '()) (foreach item layerData (setq layerName (car item)) (setq oldLt (cadr item)) (if (vl-catch-all-error-p (vl-catch-all-apply '(lambda () (setq layObj (vla-item layers layerName)) (vla-put-Linetype layObj oldLt) ) ) ) (setq failed (cons (strcat layerName " -> " oldLt) failed)) ) ) (reverse failed) ) (defun GPAE:RL-REPORT-LINETYPES (ltNames / txt name count maxCount) (setq txt "") (setq count 0) (setq maxCount 25) (foreach name ltNames (if (< count maxCount) (setq txt (strcat txt name "\n")) ) (setq count (1+ count)) ) (if (> (length ltNames) maxCount) (setq txt (strcat txt "... en nog " (itoa (- (length ltNames) maxCount)) " meer.\n" ) ) ) txt ) (defun C:RELOADLINETYPE ( / *error* doc oldExpert oldCmdecho oldCeltype oldClayer linFile ltNames layerData restoreFailed ) (vl-load-com) (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))) (setq oldExpert (getvar "EXPERT")) (setq oldCmdecho (getvar "CMDECHO")) (setq oldCeltype (getvar "CELTYPE")) (setq oldClayer (getvar "CLAYER")) (defun *error* (msg) (if oldCeltype (vl-catch-all-apply 'setvar (list "CELTYPE" oldCeltype)) ) (if oldExpert (vl-catch-all-apply 'setvar (list "EXPERT" oldExpert)) ) (if oldCmdecho (vl-catch-all-apply 'setvar (list "CMDECHO" oldCmdecho)) ) (if oldClayer (vl-catch-all-apply 'setvar (list "CLAYER" oldClayer)) ) (vl-catch-all-apply 'vla-EndUndoMark (list doc)) (if (and msg (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*EXIT*")) ) (alert (strcat "Fout in RELOADLINETYPE:\n\n" msg)) ) (princ) ) (setq linFile (getfiled "Selecteer LIN-bestand om opnieuw te laden" "" "lin" 0 ) ) (if (not linFile) (progn (princ "\nGeen LIN-bestand geselecteerd.") (princ) (exit) ) ) (if (not (findfile linFile)) (progn (alert (strcat "LIN-bestand niet gevonden:\n\n" linFile)) (princ) (exit) ) ) (setq ltNames (GPAE:RL-READ-LINETYPE-NAMES-FROM-LIN linFile)) (if (not ltNames) (progn (alert (strcat "Geen linetype-definities gevonden in:\n\n" linFile "\n\nControleer of het bestand regels bevat zoals:\n*LIJNTYPENAAM,omschrijving" ) ) (princ) (exit) ) ) (vla-StartUndoMark doc) ;; CMDECHO bewust aan, zodat -PURGE in de commandline zichtbaar is. (setvar "CMDECHO" 1) (setvar "EXPERT" 5) (setvar "CELTYPE" "Continuous") (princ "\n---------------------------------------------") (princ "\nRELOADLINETYPE gestart") (princ (strcat "\nLIN-bestand: " linFile)) (princ (strcat "\nAantal linetypes gevonden in LIN: " (itoa (length ltNames)))) (princ "\nGevonden linetypes:") (foreach linName ltNames (princ (strcat "\n - " linName)) ) (setq layerData (GPAE:RL-COLLECT-LAYERS-WITH-LINETYPES doc ltNames)) (princ (strcat "\nAantal layers tijdelijk naar Continuous: " (itoa (length layerData)))) (if layerData (progn (princ "\nLayers tijdelijk op Continuous zetten...") (GPAE:RL-SET-LAYERS-CONTINUOUS doc layerData) ) (princ "\nGeen layers gevonden die deze linetypes gebruiken.") ) (princ "\nLinetypes purgen via AutoCAD commandline...") (princ "\nUitgevoerd: -PURGE > LT > * > N") ;; Echt AutoCAD purge-commando, zichtbaar in commandline. (command "_.-PURGE" "_LT" "*" "_N") (princ "\nLIN-bestand opnieuw laden...") (command "_.-LINETYPE" "_LOAD" "*" linFile "") (princ "\nLayer-linetypes herstellen...") (setq restoreFailed (GPAE:RL-RESTORE-LAYER-LINETYPES doc layerData)) (setvar "CELTYPE" oldCeltype) (setvar "EXPERT" oldExpert) (setvar "CMDECHO" oldCmdecho) (setvar "CLAYER" oldClayer) (command "_.REGENALL") (vla-EndUndoMark doc) (princ "\n---------------------------------------------") (princ "\nRELOADLINETYPE voltooid.") (princ (strcat "\nVerwerkte linetypes uit LIN: " (itoa (length ltNames)))) (princ (strcat "\nHerstelde layers: " (itoa (- (length layerData) (length restoreFailed))))) (if restoreFailed (alert (strcat "RELOADLINETYPE voltooid, maar sommige layers konden niet worden hersteld.\n\n" "Waarschijnlijk ontbreken deze linetypes nog na het laden van de LIN.\n\n" (apply 'strcat (mapcar '(lambda (x) (strcat x "\n")) restoreFailed ) ) ) ) (alert (strcat "RELOADLINETYPE voltooid.\n\n" "LIN-bestand:\n" linFile "\n\nAantal linetypes in LIN: " (itoa (length ltNames)) "\nAantal tijdelijk aangepaste layers: " (itoa (length layerData)) ) ) ) (princ) ) (princ "\nRELOADLINETYPE geladen. Typ RELOADLINETYPE om een LIN-bestand opnieuw te laden.") (princ)
    1 point
  5. I did not know Python worked with AutoCAD. Well done, sir
    1 point
  6. You need to post a true copy of what ever your starting with as you hinted a csv or a pdf. There is nom problem reading a csv and inserting all the borehole blocks at correct location, yes can look at other details so can insert different blocks when required, That is the sort of information you are not providing. eg a csv file like this. I can see need to compare your look up table that you previously provided. Once this sort of information is posted then a complete solution can be provided. Not just questions. Bore 1 X,Y 0.5,Green dirt 1.2,Black dirt 2.4,Blue dirt Bore 2 X,Y 1.3,Green Dirt 2.2,Black dirt Bore 3 and so on
    1 point
  7. I could be wrong only glanced at code. (if (and (>= l_ang (* pi 0.5)) (< l_ang (* pi 1.5))) (setq i_ang (- l_ang pi) d_pt (polar m_pt (- i_ang (* pi 0.5)) (* tht 0.3))) (setq d_pt (polar m_pt (- i_ang (* pi 0.5)) (* tht 0.3))) );end_if ; needs a another if here (If (= ?????) (rh:em_txt m_pt a_txt b_lyr i_ang tht 1 1) (rh:em_txt d_pt l_txt d_lyr i_ang tht 1 3) );end_if Or do you need a (progn so can add in more lines to the IF is true. maybe this I don't know. Not sure about i_ang and l_ang. (if (and (>= l_ang (* pi 0.5)) (< l_ang (* pi 1.5))) (progn (setq i_ang (- l_ang pi) d_pt (polar m_pt (- i_ang (* pi 0.5)) (* tht 0.3))) (rh:em_txt m_pt a_txt b_lyr i_ang tht 1 1) ) (progn (setq d_pt (polar m_pt (- i_ang (* pi 0.5)) (* tht 0.3))) (rh:em_txt d_pt l_txt d_lyr i_ang tht 1 3) ) );end_if
    1 point
  8. Using commands to acomplish the conversion, especially batch ones, will be very slow while displaying the DXF graphics. Why not use ODBX? 1) Create a dbx doc 2) DXFIn the dxf file 3) Saveas the dbx as dwg _$ (vlax-dump-object dbx t) ; IAxDbDocument: nil ; Property values: ; Application (RO) = Exception occurred ; Blocks (RO) = #<VLA-OBJECT IAcadBlocks 000002520fe578b8> ; Database (RO) = #<VLA-OBJECT IAcadDatabase 0000025243645708> ; Dictionaries (RO) = #<VLA-OBJECT IAcadDictionaries 000002520fe56598> ; DimStyles (RO) = #<VLA-OBJECT IAcadDimStyles 000002520fe57678> ; ElevationModelSpace = 0.0 ; ElevationPaperSpace = 0.0 ; Groups (RO) = #<VLA-OBJECT IAcadGroups 000002520fe55db8> ; Layers (RO) = #<VLA-OBJECT IAcadLayers 000002520fe57558> ; Layouts (RO) = #<VLA-OBJECT IAcadLayouts 000002520fe561a8> ; Limits = (0.0 0.0 12.0 9.0) ; Linetypes (RO) = #<VLA-OBJECT IAcadLineTypes 000002520fe57798> ; Materials (RO) = #<VLA-OBJECT IAcadMaterials 000002520fe56ce8> ; ModelSpace (RO) = #<VLA-OBJECT IAcadModelSpace 0000025279adffc8> ; Name = "" ; PaperSpace (RO) = #<VLA-OBJECT IAcadPaperSpace 0000025279ae0068> ; PlotConfigurations (RO) = #<VLA-OBJECT IAcadPlotConfigurations 000002520fe567d8> ; Preferences (RO) = #<VLA-OBJECT IAcadDatabasePreferences 00000252436bc1a8> ; RegisteredApplications (RO) = #<VLA-OBJECT IAcadRegisteredApplications 000002520fe57948> ; SectionManager (RO) = Exception occurred ; SummaryInfo (RO) = #<VLA-OBJECT IAcadSummaryInfo 0000025243646068> ; TextStyles (RO) = #<VLA-OBJECT IAcadTextStyles 000002520fe579d8> ; UserCoordinateSystems (RO) = #<VLA-OBJECT IAcadUCSs 000002520fe56bc8> ; Viewports (RO) = #<VLA-OBJECT IAcadViewports 000002520fe56868> ; Views (RO) = #<VLA-OBJECT IAcadViews 000002520fe56e08> ; Methods supported: ; CopyObjects (3) ; DxfIn (2) ; DxfOut (3) ; HandleToObject (1) ; ObjectIdToObject (1) ; Open (2) ; Save () ; SaveAs (2) T
    1 point
  9. Something like this, may need to do more than once check directory exists and then check if DWG exists. ; check that pdf directory exists (setq dwgpre (strcat (getvar "dwgprefix") "\pdf")) (if (= (vl-file-directory-p dwgpre) nil) (vl-mkdir dwgpre) ) If does not exist returns nil (findfile "M:\\Mxxxxx\\Settings\\2024-2025\\B Setting\\B Setting 2024-2025.dwg")
    1 point
×
×
  • Create New...