Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Insert block onto nodes... not points

5 REPLIES 5
Reply
Message 1 of 6
mike
757 Views, 5 Replies

Insert block onto nodes... not points

I found the following lisp program (see below) and I'm trying to modify it. Right now it will insert a block onto all the points that i add in my drawing. The problem I have is I want it to insert the block on the nodes. I have a 3d solid with nodes at various points on that solid. I need to insert a block onto those nodes. The problem is those nodes are not points. Thx!

 

;;;--- Insert a block on every node found in a drawing
(defun C:NODESERT()
  (setvar "cmdecho" 0)
  (setq oldSnap(getvar "osmode"))
  (setvar "osmode" 😎
  (setq blkName(getstring T "\n Block name: "))
  (setq ang(getangle "\n Rotation angle: "))
  (setq scalef(getreal "\n Scale factor: "))
  (if(setq eset(ssget "X" (list(cons 0 "POINT"))))
    (progn
      (setq cntr 0)
      (while(< cntr (sslength eset))
        (setq en(ssname eset cntr))
        (setq enlist(entget en))
        (setq pt(cdr(assoc 10 enlist)))
        (command "-insert" blkName pt scalef scalef (angtos ang))
        (setq cntr(+ cntr 1))
      )
      (alert (strcat "\n Inserted " (itoa(- cntr 1)) " blocks!"))
    )
    (alert "No nodes found!")
  )
  (setvar "osmode" oldSnap)
  (setvar "cmdecho" 1)
  (princ)
)

5 REPLIES 5
Message 2 of 6
Kent1Cooper
in reply to: mike


@mike wrote:

.... I have a 3d solid with nodes at various points on that solid. I need to insert a block onto those nodes. The problem is those nodes are not points. ....


What are they, then?

Kent Cooper, AIA
Message 3 of 6
pbejse
in reply to: Kent1Cooper


@Kent1Cooper wrote:

 

What are they, then?


I am wondering myself.....

 

Message 4 of 6
francishc
in reply to: mike

3DSolids contain proprietary data which cannot be directly accessed by the end user.

It may be possible to access it much like proprietary objects in Civil 3D are accessed (but idk).

Accessing such objects in Civil 3D requires a vailid Civil 3D license before the following will expose the object to further use:

(SETQ aeccapp (VLA-GETINTERFACEOBJECT
                            (VLAX-GET-ACAD-OBJECT)
                              "AeccXUiLand.AeccApplication.6.0"
                            )
)

Does anyone out there know if or how 3DSolids can be similarly accessed?

Message 5 of 6
wkiernan
in reply to: mike

Have you tried the various object enablers (a different one for each version of AutoCAD)? Type "civil object enabler" into the search box at the top of the page.  They expose a limited subset of the enity data for the special objects in Civil 3D to LISP, for AutoCAD users who do not have the Civil package.

Message 6 of 6
wkiernan
in reply to: wkiernan

Also, what happens when you EXPLODE one of those 3Dsolids?  I've never tried to do it with those, but I wrote a routine once that set an UNDO mark, EXPLODEd AECC_POINTs, examined the debris, and then used the UNDO back command to restore them.  Just try doing that in the real world!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost