Jump to content

Leaderboard

Popular Content

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

  1. You can use a similar technique to display arbitrary bitmaps in a DCL or at the cursor Interesting ideas rlx
    2 points
  2. No worries, I get that we have other usages, for my work changing the position of the arc segment without changing the tangentcy is important. If it doesn't keep that I'll have to fix it afterwards every time. I updated the code in the previous post to be a little bit less gittery, but I understand that not everyone will sacrifice smoothness to have snap enabled. Therefore here is a version without snap. So the only difference with the one from Evgeny's is that you are able to type in an offset distance as well as select an (inexact) point. offset - nosnap.lsp
    1 point
  3. I'll try to find time in the coming days to modify and expand offsetea. I've found a couple of bugs in it, likely due to the lack of stress testing. Also, I'll try to find a way to rein in those arcs governed by tangents. I might include a few more improvements as well. But I'll leave that as a surprise.
    1 point
  4. oh yeah , the good ol' days of AutoCad , think I started around version 2.22 , 1987/88 or something. In that time only pull down & screen menu's , no xrefs , no model / paper space yet, IBM screens and keyboards you could knock out T-Rex with. Downside is , part of you will always be stucked in the good old days. I probably know only a couple % there is to know about AutoCad , maybe even less. I still go back to the old *mnu files for my toolbars because I still don't like ribbons. I want my buttons simple and always on the same location. But I do like colored buttons so now & again I upgrade one of my apps , this one is almost 30 years old and I couldn't live without it
    1 point
  5. 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
×
×
  • Create New...