Jump to content

Search the Community

Showing results for tags 'dcl'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions

Categories

  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

  1. Is there any chance of matchline automation using lisp in layout? I have attached sample dwg and screenshot of block for matchline. Please help. And thanks in advance. SRS.dwg
  2. I have some lisp / DCL code that allows me to pick a note from a lstbox and insert it as an MLEADER into the drawing. How should I format that note text in my code so that the fractions insert into the drawing as diagonally stacked fractions? I've tried 3#4 but it shows up just as written, not stacked diagonally Thanks for any help
  3. Hi, Written a tool for replacing (updating) blocks. Had some spare time untill my boss recently used the W-word again (work , yak!) Anywayz , its a prototype so I'm not sure its stable and safe yet because I only did some lab testing. I hope it will be usefull. Not sure if I will be able to work on it further any time soon because I still have a few ideas and wishes. gr. Rlx RlxBlk manual.doc RlxBlk.lsp RlxBlk.dcl
  4. How do convert .png to nr list for my DCL image? HI, i would like to insert an image in to my DCL. But how do i convert a image to a list of pixels? THX like in this code. V V V V V (steal:image "refresh" '( -15 -15 -15 -15 -15 -15 -15 -15 -15 009 163 165 165 173 163 009 -15 -15 -15 -15 -15 -15 -15 -15 -15 161 -15 -15 -15 -15 -15 161 175 164 164 154 175 173 171 171 163 161 -15 -15 -15 -15 -15 -15 -15 154 153 -15 -15 254 175 166 166 166 166 164 164 175 173 171 161 161 163 254 -15 -15 -15 -15 -15 154 154 163 254 164 166 166 166 166 166 166 164 154 175 152 171 161 151 163 254 -15 -15 -15 -15 154 154 154 164 166 166 166 166 166 164 165 153 009 009 161 173 173 161 151 163 254 -15 -15 -15 154 162 154 164 166 166 166 166 165 254 -15 -15 -15 -15 -15 -15 254 163 171 151 163 -15 -15 -15 152 152 162 154 164 166 166 153 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 153 171 161 009 -15 -15 152 152 152 154 154 164 164 254 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 153 161 163 -15 -15 152 152 152 152 154 154 164 164 151 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 163 171 -15 -15 152 150 150 152 152 154 164 166 156 153 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 151 163 254 -15 152 152 152 152 152 154 154 154 177 164 009 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 173 009 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 165 009 254 154 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 254 152 254 -15 -15 -15 -15 -15 -15 -15 -15 -15 254 154 175 175 175 175 175 165 173 173 173 -15 -15 152 153 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 161 164 166 166 166 164 175 173 173 173 -15 -15 152 152 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 254 164 166 166 166 177 175 173 173 -15 -15 153 150 163 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 254 156 166 166 164 175 173 173 -15 -15 254 152 150 163 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 009 156 166 166 166 164 175 173 -15 -15 -15 163 150 150 173 254 -15 -15 -15 -15 -15 -15 -15 163 156 166 166 166 166 166 175 165 -15 -15 -15 -15 152 150 150 152 173 161 009 009 161 163 154 156 166 166 166 166 166 164 177 165 -15 -15 -15 -15 254 152 150 150 152 152 162 154 154 154 164 156 156 166 166 156 151 173 164 175 -15 -15 -15 -15 -15 254 152 152 152 152 162 162 162 154 154 164 156 156 156 009 -15 -15 173 175 -15 -15 -15 -15 -15 -15 -15 161 152 152 152 152 152 162 154 154 154 163 -15 -15 -15 -15 -15 173 -15 -15 -15 -15 -15 -15 -15 -15 -15 009 163 165 152 165 163 161 -15 -15 -15 -15 -15 -15 -15 -15 -15 ) ) (defun steal:image ( key lst / i j s x y ) (setq s (fix (sqrt (length lst)))) (repeat (setq i s) (setq j 1) (repeat s (setq x (cons j x) y (cons i y) j (1+ j) ) ) (setq i (1- i)) ) (start_image key) (fill_image 0 0 (dimx_tile key) (dimy_tile key) -15) (mapcar 'vector_image x y x y lst) (end_image) )
  5. Hi all, this is a cutout of a dcl file with toggle boxes. How can I predefine the selection "lathe machine"? (So that this checkbox is always checked). Currently, the selection that was previously selected is always applied. With radio-buttons it works with "value=1", but not in this case. : toggle { key = "tool"; label = "lathe machine"; value = "1"; } Thanks so far.
  6. Hi all, I have rebuilt the dcl and lsp files for my purposes. Can someone show me how to query the set variable (with wcmatch or cond)? Thanks in advance. (defun c:MyToggles (/ Dcl_Id% Layout_A1H$ Layout_A2H$ Layout_A3V$ Layout_A3H$ Layout_A4V$ Layout_A4H$ Return#) ;----- set default variables (if (not *MyToggles@) ;unique global variable name to store dialog info (setq *MyToggles@ (list nil "0" "0" "0" "0" "0" "0")) ) (setq Layout_A1H$ (nth 1 *MyToggles@) Layout_A2H$ (nth 2 *MyToggles@) Layout_A3V$ (nth 3 *MyToggles@) Layout_A3H$ (nth 4 *MyToggles@) Layout_A4V$ (nth 5 *MyToggles@) Layout_A4H$ (nth 6 *MyToggles@) ) ;----- load dialog dcl data (setq Dcl_Id% (load_dialog "MyDialogs.dcl")) (new_dialog "MyToggles" Dcl_Id%) ;----- set dialog initial settings (set_tile "A1H" Layout_A1H$) (set_tile "A2H" Layout_A2H$) (set_tile "A3V" Layout_A3V$) (set_tile "A3H" Layout_A3H$) (set_tile "A4V" Layout_A4V$) (set_tile "A4H" Layout_A4H$) ;----- dialog actions (action_tile "A1H" "(setq Layout_A1H$ $value)") (action_tile "A2H" "(setq Layout_A2H$ $value)") (action_tile "A3V" "(setq Layout_A3V$ $value)") (action_tile "A3H" "(setq Layout_A3H$ $value)") (action_tile "A4V" "(setq Layout_A4V$ $value)") (action_tile "A4H" "(setq Layout_A4H$ $value)") (setq Return# (start_dialog)) ;----- Unload Dialog (unload_dialog Dcl_Id%) (setq *MyToggles@ (list nil Layout_A1H$ Layout_A2H$ Layout_A3V$ Layout_A3H$ Layout_A4V$ Layout_A4H$)) (princ) ;c:MyToggles ) MyToggles : dialog { key = "Title"; label = "Layouts"; //title from lsp file spacer; : boxed_column { label = "Get your Layouts:"; width = 34.26; fixed_width = true; : toggle { key = "A1H"; label = "A1 - Horizontal"; } : toggle { key = "A2H"; label = "A2 - Horizontal"; } : toggle { key = "A3V"; label = "A3 - Vertikal"; } : toggle { key = "A3H"; label = "A3 - Horizontal"; value = "1" ; //predefined selection } : toggle { key = "A4V"; label = "A4 - Vertikal"; } : toggle { key = "A4H"; label = "A4 - Horizontal"; } spacer; } spacer; ok_only; } How do I include the variable query here? (cond ((= Layout_A1H$ 1) "selected") ('T "not selected") )
  7. I have multiple objects that are closed polylines and need to enter the extrude value through the DCL interface. Some of the input boxes are left empty/blank, meaning some of object I don’t want to extrude. When I want to extrude, the script will stop when it encounters a blank or 0 value. How can I write a script to skip the blank input box? Due to limited skill, I am very basic lisp experience and DCL to complete this lisp. I hope everyone can help, thank you this is the lisp (defun c:3dext1 () (setq AR "arlayer") ;AR (setq CO "colayer") ;CO (setq FR "frlayer") ;FR (dcl_3dextr) (princ) ) (defun dcl_3dextr ( ) (setq dcl_id_PARA (load_dialog "3Dextr.dcl")) (if (not (new_dialog "dextr" dcl_id_PARA)) (exit) ) (set_tile "arval" "") (set_tile "coval" "") (set_tile "frval" "") (action_tile "accept-ht" "(get_1ht) (done_dialog 1)") (action_tile "cancel" "(done_dialog)") (setq dd (start_dialog)) (cond ((= dd 1) (main-extru)) ) (unload_dialog dcl_id_PARA) ) (defun get_1ht () (setq arh (atof (get_tile "arval"))) (setq coh (atof (get_tile "coval"))) (setq frh (atof (get_tile "frval"))) ) (defun main-extru (/) (command "_.view" "_swiso" ) (command "_.zoom" "_extents") (command "_.LAYER" "_T" AR "_S" AR "_F" "*" "") (command "_.extrude" "all" "" arh ) (command "_.LAYER" "_T" CO "_S" CO "_F" "*" "") (command "_.extrude" "all" "" coh ) (command "_.LAYER" "_T" FR "_S" FR "_F" "*" "") (command "_.extrude" "all" "" frh ) (princ) ) ;_ defun DCL here dextr : dialog { label = "extrude by val" ; :row { : edit_box {key = "arval"; label = "a"; edit_width = 3; value = "000";} : edit_box {key = "coval"; label = "c"; edit_width = 3; value = "000";} : edit_box {key = "frval"; label = "f"; edit_width = 3; value = "000";} : button { label = "OK"; key = "accept-ht"; width = 12; fixed_width = true; mnemonic = "O"; } : button { label = "Cancel"; key = "cancel"; width = 12; fixed_width = true; mnemonic = "C"; is_cancel = true; } } }
  8. Hello i want to ask if it possible to add scroll bar in boxed_column when size is bigger than fixed. Something like this and when i have more than 5-6 lines i want scroll bar not THIS Trudy : dialog { label ="Test1"; spacer; :boxed_column { label = "TRY1"; width = 30; height = 10; : row { : edit_box { key = "cod"; label = "CODE" ; width = 10; fixed_width = true; } : popup_list { key = "mod"; color = 1; label = "MODE"; width = 20; fixed_width = true; allow_accept = true; } } : row { : edit_box { key = "cod1"; label = "CODE" ; width = 10; fixed_width = true; } : popup_list { key = "mod1"; color = 1; label = "MODE"; width = 20; fixed_width = true; allow_accept = true; } } : row { : edit_box { key = "cod2"; label = "CODE" ; width = 10; fixed_width = true; } : popup_list { key = "mod2"; color = 1; label = "MODE"; width = 20; fixed_width = true; allow_accept = true; } } : row { : edit_box { key = "cod3"; label = "CODE" ; width = 10; fixed_width = true; } : popup_list { key = "mod3"; color = 1; label = "MODE"; width = 20; fixed_width = true; allow_accept = true; } } : row { : edit_box { key = "cod4"; label = "CODE" ; width = 10; fixed_width = true; } : popup_list { key = "mod4"; color = 1; label = "MODE"; width = 20; fixed_width = true; allow_accept = true; } } : row { : edit_box { key = "cod5"; label = "CODE" ; width = 10; fixed_width = true; } : popup_list { key = "mod5"; color = 1; label = "MODE"; width = 20; fixed_width = true; allow_accept = true; } } : row { : edit_box { key = "cod6"; label = "CODE" ; width = 10; fixed_width = true; } : popup_list { key = "mod6"; color = 1; label = "MODE"; width = 20; fixed_width = true; allow_accept = true; } } : row { : edit_box { key = "cod7"; label = "CODE" ; width = 10; fixed_width = true; } : popup_list { key = "mod7"; color = 1; label = "MODE"; width = 20; fixed_width = true; allow_accept = true; } } : row { : edit_box { key = "cod8"; label = "CODE" ; width = 10; fixed_width = true; } : popup_list { key = "mod8"; color = 1; label = "MODE"; width = 20; fixed_width = true; allow_accept = true; } } : row { : edit_box { key = "cod9"; label = "CODE" ; width = 10; fixed_width = true; } : popup_list { key = "mod9"; color = 1; label = "MODE"; width = 20; fixed_width = true; allow_accept = true; } } } ok_cancel; } Thank you
  9. Hello, i try to insert block view in dcl format. I want when i chose block name to have block view to. Something like this.
  10. MCOLLAR.LSPMCOLLAR.DCL Collar Drawing.dwg Hey Guys yet with another question: I created this DCL that has 5 user input and I would like it to draw this complicated collar for me. Basically, the size of the mast (monopole diameter) is given together with the thickness of the collar plate (which is the same thickness for the ring plate), then there are some fixed values that can be assumed to draw this. Hopefully 1/3 can be drawn and then array at 120 deg. DWG I posted would be a better representative. The number of bolts (5 rows shown on this picture) is only the best fit for the support - I would like it to give me all options to choose from (3 bolt pattern all the way to 9 rows). Then to make it even harder, I would like to create a shop drawing (as shown on dwg) that has detailed plan so it really should be drawn in 4 pieces (for that 1/3 of the pie) to then assign layer and hatch. Can someone drag me to the right direction and show me how to draw stuff with different arcs and trims and offsets PLEASE! I was so excited to finally show drop down menu on a DCL, now that is done, I do not know how to draw an arc with specific geometry in lisp. Thanks
  11. hanhphuc

    HP BUTTONS.lsp

    Version 1.0.1

    957 downloads

    Thank you for supporting this "HP:BUTTONS.lsp" DCL library. This routine allows you to create DCL with multiple buttons associated to DCL action_tile list on the fly. It creates DCL box with single column x nRows of buttons, 'n' depends on the length of the 'action list' usage: (hp:buttons title lst width ht) title = Name caption on top of DCL - string lst = quoted list or progn list - list width = Width of the dialod box - integer ht = height of each button - integer returns nil or any execution (progn ... ) related to action_tile Save this file into your support folder, append to your startup autoload routine. In order to optimize the user experience, it allows maxinum 15 rows however you can abjust depends on screen size. HP:BUTTONS - v1.0 Free LISP by - hanhphuc email: hanhphuc.diy@outlook.com
  12. I can convert my raw AutoLISP (.lsp) codes into Visual Lisp (.VLX) and .FAS application using AutoCAD VLISP IDE. I was looking into Autodesk App Store and downloaded some of the free applications. It was .msi. That means it will install directly on Windows and link-up with installed AutoCAD. I am very new in the App Store. Could you please help me to understand to convert my .lsp or .vlx or .fas into .msi? Thanks.
  13. TL;DR I need to connect blocks using attribute values. I created multiple blocks and attribute with different properties (Annotative, scaled attribute text to 1:50, Upside down, Backward, Invisible, Constant, Verify, Preset, Multiple lines, Lock position, Visibility parameters) Request 1: I need to request for help to create a lisp for connect with *lines between attribute definition values since their attribute insertion point or block insertion point, ignoring all properties, included caps, but Visibility parameters not should be ignored, all this just of selected blocks (dynamic blocks, regular blocks, nested blocks). (check dwg attached for more details) Request 2: Add an option for let me choice if I need to ignore just specific attributes tag. (in the attached drawing I ignored between attributes values “tipo” and “nivel”) Request 2: Add an option for let me choice if I need connect just specific attributes tag. (in the attached drawing I connected between attributes values “codigo” and “alimentador”) Request 3: Add an option for let me choice for connect blocks insert point or attribute definitions insert point (check dwg file and images for more details) PD: attached blocks with the name “connect attributes.dwg” PD: if possible use DCL or OpenDCL for the GUI. connect attributes.dwg
  14. I am trying to accomplish this lisp with no knowledge of DCL since I can check and uncheck options when I want. (Typ.) (Type) (TYP.) (TYPE) ± c/c ;option1; ± ;Dimension; c/c or C/C ;option2; ± ;Dimension; c/c or C/C then underneath the dim line to be: all four options of (Typ.)(Type)(TYP.)(TYPE) previously I had made a few lisps to do the task but it seems a DCL would be the way to go: ; Adding (Type) to the dimension line with Arial text (defun c:2 (/ Rtrn txt ss in vl) (progn (princ "\nSelect Dimension to modify: ") (setq ss (ssget "_:L" '((0 . "DIMENSION")))) ) ;end of 1st. progn (progn (setq Txt (strcat "<> " "{\\fArial|b0|i0|c0|p34;(Type)}")) (repeat (setq in (sslength ss)) (setq vl (vlax-ename->vla-object (ssname ss (setq in (1- in))))) (vl-catch-all-apply 'vla-put-TextOverride (list vl txt)) ) ) ;end 2nd. progn ; ) ; end if (princ) ) ;End Defun ; Adding ± to the dimension line keeping dim style (defun c:4 (/ Rtrn txt ss in vl) (progn (princ "\nSelect Dimension to modify: ") (setq ss (ssget "_:L" '((0 . "DIMENSION")))) ) ;end of 1st. progn (progn (setq Txt (strcat "%%P<>")) (repeat (setq in (sslength ss)) (setq vl (vlax-ename->vla-object (ssname ss (setq in (1- in))))) (vl-catch-all-apply 'vla-put-TextOverride (list vl txt)) ) ) ;end 2nd. progn ; ) ; end if (princ) ) ;End Defun for now I have them each under a command but it would be nice to have them using DCL. You see some pre/suffixes are all capital and some regular. also some are taking the dimension style formatting and some are Arial. Any help please? thank you!
  15. Hello, I just want to ask regarding the program I want to make cause I am having a problem on how to multiply the two values ( a real number and value from an input box): Part of my DCL; : edit_box { key = "sc"; label = "ENTER SCALE :"; alignment = centered; width = 10; fixed_width = true; is_enabled = false;} Part in my LISP; (set_tile "sc" "500") (mode_tile "sc" 2) (action_tile "en" "(progn (setq en $value)(mode_tile \"sc\" 0))") (action_tile "accept" "(setq scale (get_tile \"sc\") (done_dialog 1) )" ) (defun Styles() (setq size (* 0.00225 scale)) ….) but after running the program just exit. Hope someone can have time to help with this. Thank you!
  16. Hi there! I am exploring lisp and dcl at the same time. I have this DCL as shown below. Whenever the command is done and doing the same command again, values reset (pic2). I want the values to remain whenever I used the dcl again after I press "Ok" to edit particular inputs instead of typing the whole data again. How could I possibly do that? Here is the dcl code I used. CHECKING : dialog { label = "CHECKING"; : row { :boxed_row { label = "PARAMETERS"; : edit_box { key = "a"; label = "Wind Pressure (kPa)"; edit_width = 8;} : edit_box {key = "b"; label = "Tributary Width (mm)"; edit_width = 8;} : edit_box {key = "c"; label = "Unsupported Length (mm)"; edit_width = 8;} } } : row { :boxed_column { label = "SECTION PROPERTIES (ALUMINUM)"; : edit_box { key = "d"; label = "Moment of Inertia (mm^4)"; edit_width = 8;} : edit_box {key = "e"; label = "Area (mm^2)"; edit_width = 8;} : edit_box {key = "f"; label = "Extreme Fiber (mm)"; edit_width = 8;} : edit_box {key = "g"; label = "Allowable Stress (MPa)"; edit_width = 8;} } :boxed_column { label = "SECTION PROPERTIES (STEEL)"; : edit_box { key = "h"; label = "Moment of Inertia (mm^4)"; edit_width = 8;} : edit_box {key = "i"; label = "Area (mm^2)"; edit_width = 8;} : edit_box {key = "j"; label = "Extreme Fiber (mm)"; edit_width = 8;} : edit_box {key = "k"; label = "Allowable Stress (MPa)"; edit_width = 8;} } } : button { key = "accept"; label = " &OK "; is_default = true; mnemonic = "S"; } : button { key = "cancel"; label = " Cancel "; is_default = false; is_cancel = true; } } and here is the lisp code: (defun saveVars() (setq wp(distof(get_tile "a"))) (setq tw(distof(get_tile "b"))) (setq L(distof(get_tile "c"))) (setq Im(distof(get_tile "d"))) (setq Am(distof(get_tile "e"))) (setq cm(distof(get_tile "f"))) (setq Fbm(distof(get_tile "g"))) (setq Is(distof(get_tile "h"))) (setq As(distof(get_tile "i"))) (setq cs(distof(get_tile "j"))) (setq Fbs(distof(get_tile "k"))) ) (defun C:CC() (if(not(setq dcl_id (load_dialog "CHECKING.dcl"))) (progn (alert "The DCL file could not be loaded!") (exit) ) (progn (if (not(new_dialog "CHECKING" dcl_id)) (progn (alert "CHECKING.DCL file could not be loaded!") (exit) ) (progn (action_tile "accept" "(saveVars)(done_dialog 2)") (action_tile "cancel" "(done_dialog 1)") (setq ddiag(start_dialog)) (unload_dialog dcl_id) (if(= ddiag 1) (princ "\n END") ) (if(= ddiag 2) (progn (setq IT(+ Im (* 2.87 Is))) (setq moment(/ (* wp tw L L) 8000)) (setq stress(/ (* moment cm) Im)) (setq stressratio(/ stress Fbm)) (setq deflection(/ (* 5 wp tw L L L L) (* 384000 69600 IT))) (setq allowdeflection(/ L 175)) (setq defratio(/ deflection allowdeflection)) (setq pt1 (getpoint)) (setq pt2 (getpoint)) (command "_mtext" pt1 pt2 "\n Actual Bending Stress =" (rtos stress 2 2) "\n Allowable Bending Stress =" (rtos Fbm 2 2) "\n Stress Ratio =" (rtos stressratio 2 2) "\n Actual Deflection =" (rtos deflection 2 2) "\n Allowable Deflection =" (rtos allowdeflection 2 2) "\n Deflection Ratio =" (rtos defratio 2 2) "" ) ) ) ) ) ) ) ) One more thing. About the mtext output. The output is this. Numerical results always appear on the next line. and I want the result to be like this with units as text (MPa, mm, etc) Does someone has a thing about this? Thank you in advance. :)
  17. I had a conversation with a fellow CAD operator a few months ago and came across a question. Is it possible to create a DCL file that utilizes custom sprites as clickable entities? The idea is that the DCL window would show a dozen or so slide images and the user would click on the desired image to trigger the next part of the code. I know that I could show the images and place radio buttons next to them, but I feel that this could be a bit clunky. Any thoughts?
  18. Hello everyone, I’ve dove head first into the overwhelming world of Autolisp… and needless to say I’m in way over my head. I’ve been trying to put together a program for AutoCAD 14 with a dialog box that will allow the user to pick from a drop down list of standard materials/click a “select objects” button… apply selected material to 3D solids and have it display the weight based on the volume of the solid/s. Furthermore, I have added two radio buttons: one for imperial measurement and one for metric measurement. There is also another “select objects” Total button to calculate and display the combined weight of the entire 3D solid assembly. I used a program called ObjectDCL to design the dialog box (ODC file and image attached). But that’s really as far as I got. I found these links as a starting point but couldn’t figure out how to tie it all together: http://www.ellenfinkelstein.com/acadblog/create-a-custom-function-in-autocads-calculator/ http://cadtips.cadalyst.com/mass-properties/tip-2258-calculate-weight http://cadtips.cadalyst.com/mass-properties/tip-2258-calculate-weight http://www.cadtutor.net/forum/showthread.php?50384-Calculating-weight-of-2d-shape-amp-3dsolid-object-by-asigned-material&highlight=material+density http://www.cadtutor.net/forum/showthread.php?89753-Help-please-need-to-combine-to-lisp&highlight=material+density I have the list of materials ready to insert along with the densities in lbs/in^3 I’m hoping one of you programming geniuses could please put it together to get it working as it is intended. I’m also hoping that I could then study that code and get some clue as to how it all works. I'm intrigued by the potential of this programming language and would love to be introduced to it by one of the many experts on this forum. Thanks in advance and please let me know if I missed anything. Matwt.lsp ODC.zip
  19. Hello again Masters and Legends, I'm currently learning DCL right now thru Afralisp.net and some autodesk forum topics. From their examples, a DCL file is paired with a LSP file to work. For example, I have a DCL and its pair LSP file, its function is just to collect names, some numbers, places, (and any other data). Is it possible that any other LSP routine can use the data stored/inputted on the DCL? If it is, how? I just dont know. Thanks again. more power!
  20. I know how to do this and have done it. BUT. I have multiple products.ini, products2.ini files where i get the values for popup_list. The first selected is ok. However when i change to the external ini file to the next ini file. The content of the popup_list is still the one i have used at first. I cant post the whole lisp nor DCL but has someone experienced this before and how can i "flush" the old external ini values? Thanks.
  21. Hi, I was working with a DCL and Lisp a few days and got some doubts: 1 - radio_button: 1.1 - Has there a way to check between a number "x" of radio_button, which is the currently radio_button selected? 1.2 - To run the code and to select a first item, I use on DCL file, as enabled: is_enabled = true (it only put a dot on that item, but not select it as a click over there, in other words, only show a dot image). On lisp code I wrote to try to execute a action: (set_tile "rb1" 1), but not works, in the same way not as a click over there. 2 - toggle_button. 2.1 - The toggle button has a possibility to do a action_tile when it is pressed a first time (before to be selected), to "deselect" it is there a whay to do one action? eg.: when I select the toggle, I show one image, but when I deselect it, the image need to be changed, is there how to do it? Thanks in advance to any help!...
  22. Hi to all, I need a basic instructions to try to learn with DCL files!... 1 - How I can show a preview of a image in a chosen item in one toggle button, I have 3 toggles to select, when one of them is chosen it will show a preview of the image (the image is a block inside of dwg file); 2 - Chose, how I can start a Dialog with one item selected (the variable [value = "1"], only fill a image as selected item, but don't select it. Thanks in advance to any help.
  23. Hi Everyone, I've been lurking here for over a year now and have found lots of useful information (thanks!), but I've finally done something that doesn't seem to have been solved before, and that there may be no easy answer to. We use a complicated system of layer states, views, and freezing and unfreezing layers to set up different print states to create a package of drawings. It is sort of a wacky use of AutoCAD, but this is due to the necessity of showing an opera as it progresses through time (Act 1, Act 2, etc.). We have hundreds of operas in our repertory and this won't be changing anytime soon. Anyway, as it stands now, there is a .txt file that lives in the same directory as the file containing the scenery that is manually created so that print scripts can work. I am attempting to turn that .txt file into something that lives in a dialog box for ease of use and cleanliness. The data will be stored in a mulitline attribute in a block. I've spent a fair amount of time creating a dialog box that changes size dynamically, allows for reordering of printouts and having multiple scenery layers appear on the same printout. My only real issue (which is of course a big one) is that if you add too many rows, the dialog box becomes too big to fit on the screen. What I would love to be able to do is to make the whole box (except the buttons at the bottom) scroll up and down so that the height of the dialog box is fixed to the smallest screen we use here (~800 pixels). I've spent a little time with OpenDCL but find it a bit byzantine, and I don't know any .NET or VBA so either of those solutions will involve me learning some new programming languages--not necessarily a deal breaker but not ideal either. I'm attaching a .dwg with the attributed block and the .lsp file for anyone who wants to take a look. The command c:met_plot_2015 will create and open the dialog box, which you can then manipulate. I appreciate anyone who read to the end of this post, and any help you can provide. Thanks, Eric P.S. The printing function doesn't actually work yet; that's next on the list once I solve this. specialblock.dwg BETTERPRINTING 5.LSP
  24. Hello Everyone, I am trying to work on DCL program for my coworker and I. I went through the tutorials by Kenny on Afralisp but I am stuck. My DCL keeps freezing. I tried checking it in Visual Lisp Editor and I couldn't figure it out. If anyone has any suggestions on DCL resources. I want to write a larger program for generating detail sheets for company but have a lot to learn. Is there a better way to write interfaces than DCL? ;;;;Original Code by by Kenny Ramage (defun C:PL_TRADE_SELECT () ;define function (setq PL_FILE (findfile "PL_WEIGHT.DAT")) (setq CODE_CHOICE "2007 OPA") ; (setq CODES "*COV_CODES") ; (list_find PL_FILE CODES) ; (setq CODE_LIST FIND_RESULT) ; (setq FIND_RESULT nil) ; (setq CODE_LIST_MOD (COMMA_PULL CODE_LIST "STRING")) (setq CODE_LIST_MOD '("1998 CBC" "2003 IBC" "2007 OPA")) ; (setq dcl_id (load_dialog "PL_TRADE_SELECT.dcl")) ;load dialog (if (not (new_dialog "PL_TRADE_SELECT" dcl_id) ;test for dialog );not (exit) ;exit if no dialog );if (setq w (dimx_tile "im") ;get image tile width h (dimy_tile "im") ;get image tile height );setq (start_image "im") ;start the image (fill_image 0 0 w h 5) ;fill it with blue (end_image) ;end image (start_list "CODE_CHOICES") ;start the list box (mapcar 'add_list CODE_LIST_MOD) ;fill the list box (end_list) ;end list (action_tile "PU" "(setq PL_TYPE \"PU\")") ;store point load type (action_tile "MP" "(setq PL_TYPE \"MP\")") ;store point load type (action_tile "HV" "(setq PL_TYPE \"HV\")") ;store point load type (action_tile "EL" "(setq PL_TYPE \"EL\")") ;store point load type (action_tile "cancel" ;if cancel button pressed "(done_dialog) (setq userclick nil)" ;close dialog, set flag );action_tile (action_tile "accept" ;if O.K. pressed (strcat ;string 'em together "(progn (setq CODE_CHOICE (atof (get_tile \"CODE_CHOICES\")))" ;get list selection " (done_dialog)(setq userclick T))" ;close dialog, set flag );strcat );action tile (start_dialog) ;start dialog (unload_dialog dcl_id) ;unload (if userclick ;check O.K. was selected (progn (setq CODE_CHOICE (fix CODE_CHOICE)) ;convert to integer (setq CODE_CHOICE (nth CODE_CHOICE CODE_LIST_MOD)) ;get the size );progn );if userclick (princ) );defun C:PL_TRADE_SELECT (princ) And the DCL... PL_TRADE_SELECT : dialog { //dialog name label = "Point Load Trade Selection" ; //give it a label :boxed_radio_column { //define radio column label = "&Code" ; //give it a label : popup_list { //define popup list key = "CODE_CHOICES"; //give it a name value = "2007 OPA" ; //initial value } //end list } :boxed_radio_column { //define radio column label = "Trade" ; //give it a label : radio_button { //define radion button key = "PU" ; //give it a name label = "&Plumbing" ; //give ]it a label value = "1" ; //switch it on } //end definition : radio_button { //define radio button key = "MP" ; //give it a name label = "&Mechancical Pipe" ; //give it a label } //end definition : radio_button { //define radio button key = "HV" ; //give it a name label = "&HVAC" ; //give it a label } //end definition : radio_button { //define radio button key = "EL" ; //give it a name label = "&Electrical" ; //give it a label } //end definition } //end radio column ok_cancel ; //predifined OK/Cancel : row { //define row : image { //define image tile key = "im" ; //give it a name height = 1.0 ; //and a height width = 1.0 ; //and now a width } //end image : paragraph { //define paragraph : text_part { //define text label = "Message 1"; //give it some text } //end text : text_part { //define more text label = "Message 2"; //some more text } //end text } //end paragraph } //end row }
  25. I have made updates to an old library block (file) and saved my changes. We have a custom menu, custom program and dialog box shows all different blocks to choose from and I frequently use it. The inserted block shows updates correctly but wont change the thumbnail preview inside the dialog box. Its not an attribute block or a dynamic block. Is there anyway to resolve the preview issue?
×
×
  • Create New...