Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/22/2024 in all areas

  1. Yes works fine. Thanks
    1 point
  2. I guess there are good reasons you're not using the pipe network tools in Civil 3D, because you could just define a label style for a structure and be done with it. Here's some simple code for editing attributes inside dynamic blocks. You may have to call the routine three times in a container function, once for each type of variable. For the inverts, I would begin by setting to zero, getting the value, and resetting the variable only if it exists. And as always, Lee Mac did it first: here are some helpful dynamic block functions. My diesel-fu is rusty, does your code do anything besides handle the window and get user input? What are you trying to do that's not possible in the usual attribute editor, besides validating the input?
    1 point
  3. I am not sure how the first one doesn't give a preview... in testing it gives a preview for me. I use .pc3 files for plotting and not .pc5. What I have is a copy of the DWG to PDF.pc3 plotter (go to page setup, modify, select "Dwg to PDF.pc3", Properties, 'Save as', and I call mine "Dwg to PDF - No Preview.pc3"), then in PDF options de-select "Show Results in Viewer". You should now have 2 DWG to PDF plotters, and you can select which one to use. Modify your code above to use the preview or no preview plotter.
    1 point
  4. You can work in a wireframe mode or shaded. It doesn't really matter. With osnap set to end, create a UCS referencing vertices 1, 2, 3 the create a polyline from 1 to 2 to 3 and c (closed). Then create another ucs with vertices 1, 4, 5, and then a polyline from 1 to 4 to 5 and close. Now use loft!
    1 point
  5. Try this: I don't know which is your architectural layer, so the filer is for layer AM-5 - search for this in the LISP and change to suit. For now blocks will be on layer XR but whatever is in the block will be as it is now (unchanged). Dimensions and leaders will be move to layer XR for colour over rides (line colours, arrow colours) will be as they are just now. Command: text (defun c:test ( / ) ;;Sub Functions ;;Check layer exists or create layer (defun checklaystyle (LayDef / ) ; 1-6 in def LISP, 7 is transparency: Check or create layer (defun LM:setlayertransparency ( lay trn / ent ) (defun LM:trans->dxf ( x ) (logior (fix (* 2.55 (- 100 x))) 33554432) ) (if (setq ent (tblobjname "layer" lay)) (progn (regapp "accmtransparency") (entmod (append (entget ent) (list (list -3 (list "accmtransparency" (cons 1071 (LM:trans->dxf trn)) ) ; end list ) ; end list ))) ; end entmod ) ; end progn ) ; end if ) ; end defun (setq Layname (nth 1 LayDef)) (if ;;check for layer style (or (= NIL (tblsearch "layer" Layname))(/= (cdr (assoc 2 (tblsearch "layer" Layname))) 0.0) ) (progn (setq style (entmakex (list '(000 . "LAYER") '(100 . "AcDbSymbolTableRecord") '(100 . "AcDbLayerTableRecord") (cons 002 (nth 1 LayDef)) ; layer name (cons 070 (atoi (nth 2 LayDef))) ; (cons 062 (atoi (nth 3 LayDef))) ; colour (cons 006 (if (tblsearch "LTYPE" (nth 4 LayDef)) (nth 4 LayDef) "Continuous")) ; line type (cons 290 (atoi (nth 5 LayDef))) ; (if (or (= (nth 6 LayDef) nil)(= (nth 6 LayDef) "")) ; plotting (cons 370 -3) (cons 370 (atoi (nth 6 LayDef))) ) ))) ; end list, end entmake, end style (if (> (length layDef) 8) (LM:setlayertransparency Layname (atoi (nth 7 LayDef)) ) ) ) ;end progn ) ; end if ) ;;Purge all (defun c:purgea( / endloop sel) (setq NoMutt_Old (getvar 'NoMutt)) (repeat 3 (setvar 'NoMutt 1) (command "-PURGE" "A" "*" "N") (command "-PURGE" "R" "*" "N") ;;Regapps (setvar 'NoMutt NoMutt_Old) ) (princ "\nPurge All complete.") (princ) ) ;; End sub functions (checklaystyle '("LAYER" "XR" "0" "0" "Continuous" "1" "-3" "0.0000") ) ;;layer Name flags Colour linetype plotting lineweight Transparency) (if (setq MySS (ssget "X" '((8 . "AM_5")))) ; select all on layer "AM_5" (progn (setq acount 0) (while (< acount (sslength MySS)) ; Loop through selection (setq MyEnt (ssname MySS acount)) ; Get each entity defition (setq ed (entget MyEnt)) (setq ed (subst (cons 62 256) (assoc 62 ed) ed )) (setq ed (subst (cons 8 "XR") (assoc 8 ed) ed )) (entmod ed) ; Modify & update entity (setq acount (+ acount 1)) ) ; end while (c:purgea) ; Purge all )) ; end if end progn (princ) )
    1 point
  6. 1 point
  7. $ (/ 23678 1000.) 23.678 _$ (/ 23678 100.) 236.78 _$ That was too easy... Are the numbers you want to convert Integers or Strings? If you expect to select them from the dwg they are most likely to be strings.
    1 point
×
×
  • Create New...