Jump to content

Recommended Posts

Posted

Is it possible to draw a 3D object by lisp? For example a box? The answer will be "yes" I am sure...

 

But I just can't seem to find any info about it using my friend. If somebody would be so kind to give me some hints / keywords then I can dig up a little info.

 

Thanks in advance!

Posted

I am not a 3d user , and this is what I come up with from the help .

 

(vla-addbox
 (vla-get-ModelSpace
   (vla-get-ActiveDocument (vlax-get-acad-object))
 )
 (vlax-3d-point 0. 0. 0.)  1.  1.  1. )

 

Tharwat

Posted

Thanks Tharwat!

It is a nice start. I went looking for the function vla-addbox.

 

Creates a 3D solid box with edges parallel to the axes of the WCS.

Signature

RetVal = object.AddBox(Origin, Length, Width, Height)

Object

ModelSpace Collection, PaperSpace Collection, Block

The object or objects this method applies to.

Origin

Variant (three-element array of doubles); input-only

The 3D WCS coordinates specifying the origin of the box. This coordinate represents the center of the bounding box for the object, not a corner.

Length

Double; input-only

The length of the box. Must be a positive number.

Width

Double; input-only

The width of the box. Must be a positive number.

Height

Double; input-only

The height of the box. Must be a positive number.

RetVal

3DSolid object

A 3DSolid object as the newly created box.

A quick copy of the help menu I have found in an old version. I will dig into that!

 

;; Draws a box 
(defun c:test nil
 (vl-load-com)
 (vla-addbox
   (vla-get-ModelSpace
     (vla-get-ActiveDocument (vlax-get-acad-object))
   )
   (vlax-3d-point 0. 0. 0.)
   1.
   1.
   1.
 )
) ;_defun

 

Any further info is also appreciated.

Posted

Sorry Lee you can cheat on surfaces they can be made Macrow has not hinted to complex about what he is trying to achieve.

 

use

Thickness

3dface

PFACE

 

Only draw back is they are all single planar, pface works great for house roofs.

Posted
Sorry Lee you can cheat on surfaces they can be made Macrow has not hinted to complex about what he is trying to achieve.

 

Sorry, I was just referring to ActiveX:

 

Surface object

 

Access via:

ModelSpace.Item

PaperSpace.Item

Block.Item

SelectionSet.Item

Group.Item

 

This object provides access to surfaces in AutoCAD. It lets you manipulate properties of the surface. You cannot create a surface entity via ActiveX.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...