Jump to content

Search the Community

Showing results for tags 'special characters'.

  • 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...

Found 3 results

  1. Hi, Why sometimes this operation returns wrong: (defun c:cvt() (setq oldname "ESP - Esquadrias CIR")(setq newname "ANT - Esquadria Círculo")(runtorenamelayer) ) (defun runtorenamelayer() (if (and(tblsearch "layer" oldname)(not(tblsearch "layer" newname))) (COMMAND "._-RENAME" "LA" OLDNAME NEWNAME);;(command "._-layer" "R" oldname newname "") ) (if (and(tblsearch "layer" oldname)(tblsearch "layer" newname)) (progn (command "Laymrg") (foreach e (list oldname) (if (tblsearch "LAYER" e)(command "_Name" e)))(command "" "_N" newname "_Y") ;;(command "_.-PURGE" "_La" oldname "_N") ) ) (princ) ) Being specific, if I load the code with the appload or even in the ACAD.LSP the problem occurs. And the result is a strange name: ANT - Esquadria Círculo If I just copy and paste the code into the command bar it works fine and te name is ok: ANT - Esquadria Círculo Ok, I am thinking about avoiding special characters in the new Layer names, but in some cases the old layers have them already, and in this situation the operation doesn't rename that old layers, the application just skip them because the names doesn't match. TIA
  2. Hi folks My target was to do a little routine that creates layouts for the views and sets page setups for these layouts. Name of the page setup is asked from the user before making the layouts and I try to use PromptKeywordOptions so that user can only select existing page setups. And here comes the problem. If there is underscore (_) or more in the page setup's name and I type that name, I get error "Invalid option keyword." in the command line. When I messed with page setup manager and tried to rename setups with special characters, I got the following message: "The following characters are not supported: \ / ? " : ; * | , = `". but there are no mention about the underscore. How do I select the name with underscore or do I have to replace all underscores from my page setup names? Here is the routine for selecting page setup: using Autodesk.AutoCAD.EditorInput; using Autodesk.AutoCAD.Runtime; using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.DatabaseServices; using System; using System.Collections.Generic; namespace CAD { public class PageSetupSelector { Document doc; [CommandMethod("SelectPageSetup")] public void SelectPageSetup() { doc = Application.DocumentManager.MdiActiveDocument; Database db = doc.Database; using (Transaction trans = db.TransactionManager.StartTransaction()) { DBDictionary pageSetups = (DBDictionary)trans.GetObject(db.PlotSettingsDictionaryId, OpenMode.ForRead); List<string> setupNames = new List<string>(); doc.Editor.WriteMessage("\nPage setups:"); foreach (DBDictionaryEntry entry in pageSetups) { doc.Editor.WriteMessage("\n {0}", entry.Key); setupNames.Add(entry.Key); } if (pageSetups.Count > 0) { string question = "\nSelect pagesetup: "; string answer = AskKeywordFromUser(question, setupNames.ToArray(), setupNames[0]); doc.Editor.WriteMessage("\nSelected setup: {0} ", answer); } trans.Abort(); } } protected string AskKeywordFromUser(string question, string[] words, string defaultWord) { PromptKeywordOptions pko = new PromptKeywordOptions(""); pko.Message = question; pko.AllowNone = false; foreach (string word in words) { pko.Keywords.Add(word); } pko.Keywords.Default = defaultWord; PromptResult pr = doc.Editor.GetKeywords(pko); if (pr.Status != PromptStatus.OK) { return String.Empty; } return pr.StringResult; } } } And here is the output from the command line: Page setups: test-A3 test_A3 Select pagesetup [test-A3/test_A3] <test-A3>: test_A3 Invalid option keyword. Select pagesetup [test-A3/test_A3] <test-A3>: "test_A3" Invalid option keyword. Select pagesetup [test-A3/test_A3] <test-A3>: 'test_A3' Invalid option keyword. Select pagesetup [test-A3/test_A3] <test-A3>: Selected setup: test-A3
  3. here it is if i want to put m (cube) is there is any way to put m^3 in autocad as it is in unit.how to get special characters in autocad....
×
×
  • Create New...