Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/22/2018 in all areas

  1. Hi Tony, Don't get me wrong, but you don't seem to have enough experience. Where experience != knowledge. Judging by your requests from your posts, all of them can be done with AutoLISP. Here are two examples to create a simple line - AutoLISP : (setq p1 '(5. 5. 0)) (setq p2 '(12. 3. 0.)) (entmakex (cons '(0 . "LINE") (mapcar 'cons '(10 11) (list p1 p2)))) C# (.NET) /source/ : using Autodesk.AutoCAD.Runtime; using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.Geometry; [CommandMethod("AddLine")] public static void AddLine() { // Get the current document and database Document acDoc = Application.DocumentManager.MdiActiveDocument; Database acCurDb = acDoc.Database; // Start a transaction using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction()) { // Open the Block table for read BlockTable acBlkTbl; acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead) as BlockTable; // Open the Block table record Model space for write BlockTableRecord acBlkTblRec; acBlkTblRec = acTrans.GetObject(acBlkTbl[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord; // Create a line that starts at 5,5 and ends at 12,3 using (Line acLine = new Line(new Point3d(5, 5, 0), new Point3d(12, 3, 0))) { // Add the new object to the block table record and the transaction acBlkTblRec.AppendEntity(acLine); acTrans.AddNewlyCreatedDBObject(acLine, true); } // Save the new object to the database acTrans.Commit(); } } Its true that AutoLISP is limited (although I don't know by how much and at which aspects), but as you can see its alot simplier to use, shorter and easier to maintain. I only know one huge drawback that is within the DCL dialogs (not enough event handlers for the tiles/controls.. like mouse_hover / mouse_leave ), so you can't be that fancy in there. But as long you get the job done, who cares ? I have this real-life friend that brags about learning the powerful language C#, but also null experience (and doesn't seem that he's about to sit and write some actual code). So when I ask, Q: Ok so what you are able to do with it? A: IDK, but I've heard many things can be done in C# Q: Check out this TicTacToe code I wrote in C# A: Sorry, but I don't understand it and I get lost at it (reason is because when one doesn't practice, isn't able to follow any code's algorithm) So the answer is short - open up that Notepad++/VLIDE/Visual Studio and start to practice, so you'll build your own opinion (and it will change quite few times).
    2 points
  2. If you a re talking strictly AutoCAD based programming languages: Common lisp is one the oldest languages a round AutoLSP (AutoCADs version of common LISP) has been around 25+ years. It is not going anywhere unless AutoDESK looses a few more brain cells. Bricscad is doing a nice job of developing their lisp interface Visual LSP is going on 15-20 years and has some enhanced functions and like Vanilla AutoLISP, it is no addtional cost incorporated into plain AutoCAD I thought VB had been abandoned a good while ago as a legacy language Vanilla AutoLISP in conjunction with DOSLIB functions can preform the vast majority of customization needs that I see requests for. It's more about programmer's skills and knowledge than the language's limitations Various languages can be compiled to run in AutoCAD as EXE EXP ARX but they are VERY complex and historically have had to been recompiled regularly HTML5 may 1 day be thing . Who knows ! C+ F Maybe ! My advice is to learn and be proficient in a simple language . And then try an advanced 1 if you need to. -David
    2 points
  3. This must be better: (foreach string '("a" "b" "c") (write-line string fn) )
    1 point
  4. There is a poke method in lisp that would allow for long strings. I have seen this but it’s not used very often. Peek and poke is for reading database style files.
    1 point
  5. How about write-char? p/s : FYI I've seen software similar @Tharwat's split method to convert string to (eg: com port devices) '*.raw' format which string data was 'chopped' to an 8bit-block (128 ascii char for each line) with bcc checksum
    1 point
  6. Alternatively, you could use the WriteLine method of the FSO.
    1 point
  7. Divide the long string into parts to be able to write them to your target file.
    1 point
  8. The FAS format is the compiled version of an AutoLISP file, and one can guess that the programmer had a good reason to don’t provide his/her routine in plain code. If you really need to have access to that code, then I believe that is better to contact the programmer then to attempt to de-compile his/her work.
    1 point
×
×
  • Create New...