Jump to content

Leaderboard

  1. BIGAL

    BIGAL

    Trusted Member


    • Points

      4

    • Posts

      19,664


  2. GLAVCVS

    GLAVCVS

    Community Member


    • Points

      2

    • Posts

      668


  3. Danielm103

    Danielm103

    Community Member


    • Points

      1

    • Posts

      205


  4. Lee Mac

    Lee Mac

    Trusted Member


    • Points

      1

    • Posts

      21,014


Popular Content

Showing content with the highest reputation on 07/05/2025 in all areas

  1. Hi Like @Stevenp, I can't verify exactly what this is about either: I'm not in front of a PC. But it looks like the last SPoint is 'nil' because '(+ Counter ForwardVisDistance)' is a number greater than the length of 'selPline'. There are a few lines of code that are unnecessary, but they don't prevent your routine from working, so just try changing (while (< Counter SelPline_Length) to (while (and (setq EPoint (vlax-curve-getPointAtDist SelPline (+ Counter ForwardVisDistance))) (setq SPoint (vlax-curve-getPointAtDist SelPline Counter))) It looks like you used AI to do this, but you should still be able to remove the excess code after making these changes.
    2 points
  2. I incorporated nanoflann( https://github.com/jlblancoc/nanoflann) wrappers into PyRx. Although other efficient KD-Tree implementations exist in Python, such as pykdtree, the wrapper is specifically designed for AcGePoint2d/AcGePoint3d, eliminating the need for type conversions. How can these structures be beneficial in CAD? in this example, we search for a phone within a certain radius of each computer. Additionally, we can identify computers that do not have phones. We could also do something like, search all MTexts on the Layer "Employee" to determine whether they are near a chair, phone, or computer. import traceback from pyrx import Ap, Ax, Db, Ed, Ge, Gi, command # radiusSearch @command def doit(): db = Db.curDb() phones, computers = getBlocks(db) result = [] # create the tree of phone locations phonePoints = Ge.Point3dArray() for phone in phones: phonePoints.append(phone[1]) phoneTree = Ge.Point3dTree(phonePoints) # search for nerby phones for computer in computers: idxs, _ = phoneTree.radiusSearch(computer[1], 50 * 50)# sqrd if len(idxs) == 0: print("no phone") continue for idx in idxs: result.append((computer, phones[idx])) for cpu, phn in result: Ed.Core.grDraw(cpu[1], phn[1], 2, 0) # helper, store the id and position def getBlocks(db: Db.Database): phones = [] computers = [] model = Db.BlockTableRecord(db.modelSpaceId()) refs = [Db.BlockReference(id) for id in model.objectIds(Db.BlockReference.desc())] for ref in refs: if ref.getBlockName() == "COMPUTER": computers.append((ref.objectId(), ref.position())) elif ref.getBlockName() == "FNPHONE": phones.append((ref.objectId(), ref.position())) return phones, computers
    1 point
  3. Ignoring the code for the moment, "Civil Site Design" has check site lines and it checks against the terrain model and the vertical alignment, not just a 2D answer. Looks at the drivers eye height and target height which is part of the check for us here in AUS.
    1 point
  4. Sounds like on the last run through the while loop SPoint is having an error... if you look at (setq SPoint (vlax-curve-getPointAtDist SelPline (+ Counter inc))) - do you need this line since at the start of the next loop you are setting SPoint again and before it is used.
    1 point
  5. A lisp version hope fully works in LT. Change the xxx and path etc. (setq *files* (vla-get-files (vla-get-preferences (vlax-get-Acad-object)))) (setq paths (vla-get-SupportPath *files*)) (if (wcmatch paths "*XXX*") (princ) (vla-put-SupportPath *files* (strcat "C:\\XXX-CAD-TOOLS" ";" paths)) ) Copy the 1st two lines to the command line as a test in LT. You should see a list of your support paths C:\\Users\\XXXX\\AppData\\Roaming\\Bricsys\\BricsCAD\\V25x64\\en_US\\Support;D:\\Bricsys\\BricsCAD V24 en_US\\Support; Oh yeah if using Autocad need to add trusted paths, Trusted paths is a bit of why ? As you can set the paths so why have it. (if (> (vl-string-search "BricsCAD" (getvar 'acadver)) 0) (princ "Bricscad") (progn (setq oldtrust (getvar 'trustedpaths)) (if (wcmatch oldtrust "*XXX*") (princ) (setvar 'trustedpaths (strcat oldtrust ";" "c:\\XXX-CAD-TOOLS")) ) ) )
    1 point
  6. Providing you have made a menu and it sits on the server, that will call the lisps. You just need to load that CUIX on each pc. If you add more to that menu, load it so it makes a new CUIX, when a user starts there CAD the latest CUI or CUIX will be loaded. Ok the only other thing you need to do is add the server support paths to each pc. This way you can use just a lisp name not its full path address in your menu. By having all the lisps on the server you control if they are changed or new ones added and always the latest version. Finally I have a setup.lsp it does all the add support paths and load the new menu. So takes like 10 seconds as it sits on the server. Ask if you want more info. Just a comment this menu has some 130 lisps behind it. One of 2 for civil works. As suggested we also had some lisps that were autoloaded on startup. Appload "Startup Suite" but we did not load every lisp we had, used the menu for that.
    1 point
  7. This tutorial may be of some help: Prompting with a Default Option.
    1 point
  8. I wrote elsewhere like renderman that we used to add the serial numbers to our lisp code and then use protect (PS do you want a copy of "unprotect" its not real good protection) any way there is a simple way to add the serial checking to your code using the operating system you can write a batch file (txt file) that copies the serial code to every lisp file you have then protects it. Batch file copy serial.lsp+mylisp1.lsp mylisp1protect.lsp Protect mylisp1protect.lsp f:\lisp\mylisp1.lsp keep repeating for all lisps The serial lsp could just look for a file somewhere say if you work on a network like Companyname. It a nucianse if someone borrows the code so they know they have done the wrong thing when they read a message then lisp exit's (exit) found a copy (setq run (getvar "_pkser")) (if (or (= run "123-22341988")(= run "123-123560429")) (princ "\nSecurity check passed") (progn (princ "\nYou have tried to run my software on a non authorised machine") (princ "\nPlease contact me on 123 4560789") (/e) ) ) It does work had some one ring up once who was trying to install on a friends machine. Word of warning though if you lock the code it must still work after your gone or get new pc's etc
    1 point
×
×
  • Create New...