Jump to content

Search the Community

Showing results for tags 'conditionals'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • 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


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

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...

Found 2 results

  1. Hello, I have some title blocks and PO sheets that contain company information like address, phone, etc. However, in my company the CAD for all branches is done in one location, so this information will need to change depending on which branch the project is for. Right now we use DWGPROPS to fill out job specific information such as JobName, Client, SiteAddress, etc. I would like to include the "Branch Name" in here as well (ie. Vancouver, Calgary, etc), with other fields referencing this entry to fill out the office phone, address, fax, etc, so that we don't need to fill in all of that info manually for every new project. However, I can't find any way to use a custom property in a conditional, ie, something like: if CustomDP.Branch=="CALGARY" then [Phone number]="XXX-XXX-XXXX", elseif CustomDP.Branch=="VANCOUVER" then [Phone number]="YYY-YYY-YYYY" It seems that a "formula" field is able to include nested fields, but is unable to handle conditional statements or branching paths. A DIESEL expression may work, but seems to be completely unable to reference custom DWGPROPS. DIESEL seems unable to reference object properties either, so I also can't do an intermediate attribute that is then referenced by a DIESEL expression. Is there any way to get this functionality? If possible I would really prefer to do it with fields or with some other method that stays self-contained within the template drawing, rather than requiring me to run VB code on every CAD machine in the office. Right now my workaround is is to rename the user profile with the branch name, as that is an easily editable acad variable that is accessible by DIESEL. It kind of works but the issue is that the profile name is global, not saved per project, so I often see POs going out with the wrong "Ship To" address when guys forget to change their profile between projects. Thanks,
  2. I have a small app that (with the help of those here) I have pieced together. I don't know how to do add error checking (or conditionals) so that I don't get scrolling errors for the items that are not found. Also, I think some of the items could be combined for my (ssget "x") but I'm not clear on how that works either. Requesting tweaking of my code or guidance. Warning: I am still a novice... Here is my code: (DEFUN C:SW1 () (Prompt "SolidWorks DWG Cleanup:") (setq TEST (tblsearch "LAYER" "Dim")) (if (= TEST nil) (progn (Command "-layer" "n" "Dim" "C" "Red" "Dim" "") ) ) (setq ss1 (ssget "x" '((0 . "INSERT")(2 . "*SW_CENTERMARKSYMBOL_*")))) (Command "Erase" SS1 "") (setq ss2 (ssget "x" '((0 . "INSERT")(2 . "*SW_NOTE_1*")))) (Command "Erase" SS2 "") (setq ss3 (ssget "x" '((0 . "INSERT")(2 . "*SW_TABLEANNOTATION_0*")))) (Command "Erase" SS3 "") (Command "-style" "Romans" "romans" "" "0.9" "" "" "n" "n") (princ "\nRomans Text Style Created:") (command "dimstyle" "r" "standard") (command "dimtxsty" "romans") (Command "dimstyle" "s" "standard" "y" ) (if (setq ss (ssget "x" '((0 . "DIMENSION")))) (repeat (setq i (sslength ss)) (setq sset (ssname ss (setq i (1- i)))) (if (not (eq (cdr (assoc 3 (setq e (entget sset)))) "Standard")) (entmod (subst (cons 3 "Standard") (assoc 3 e) e)) ) ) (princ) ) (setq ss4 (ssget "x" '((0 . "DIMENSION")))) (Command "_CHANGE" SS4 "" "P" "LA" "DIM" "C" "BYLAYER" "") (Command "_LAYER" "C" "GREEN" "X50" "C" "yellow" "TEXT" "") (setq ss5 (ssget "x" '((6 . "PHANTOM")))) (Command "_CHANGE" SS5 "" "P" "LA" "X25" "C" "BYLAYER" "LT" "PHANTOM" "") (setq ss6 (ssget "x" '((6 . "HIDDEN")))) (Command "_CHANGE" SS6 "" "P" "LA" "X25" "C" "BYLAYER" "LT" "HIDDEN" "") (setq ss7 (ssget "x" '((6 . "DASHED")))) (Command "_CHANGE" SS7 "" "P" "LA" "X25" "C" "BYLAYER" "LT" "DASHED" "") (princ)) Thanks to all...
  • Create New...