Jump to content

Recommended Posts

Posted

this is probably super simple but can't find the answer:

 

(setq apr (vlax-ename->vla-object (entlast)));#<VLA-OBJECT IAcadRegion 000002c2d9920cb8> 
(vla-put-Normal apr '(0.0 0.0 1.0)); error: ActiveX Server returned an error: Type mismatch
(vla-Update apr)

  • Replies 24
  • Created
  • Last Reply

Top Posters In This Topic

  • eimimitu

    12

  • Hippe013

    5

  • rlx

    4

  • poulhein

    2

Posted
(vla-put-normal apr (vlax-3d-point 0.0 0.0 1.0))

Posted

Unfortunately not the issue... same error...:(

Posted

I just noticed that you are selecting a region. That is the problem.

Posted

oh!... What's wrong with regions... Documentation says they're valid entities for normal property.

Posted

Documentation says that it has a Normal Property. Object browser shows the normal property of the region to be read only.

Posted

aww... thats bull**** Autodesk!

 

well damn thanks for clearing that up Hippe... trying to rotate regions to WCS short of exploding it into individual segments...

Any workarounds for this?

Posted

What exactly are you trying to do?

Posted

extract the original profile from a 3DSOLID extrusion to be exact... to use as a graphic on a count table.

Posted

it's kinda like a bill of materials of a certain trim shape but i need to indicate the shape somehow

Posted

So I suppose the next question is why do you need to change normals of the region? Isn’t there already built in commands for for showing sections of a 3D solid? If I may, this may not be a programming issue but simply a work flow issue.

Posted

The trim pieces are oriented in different directions (up wall panels and along ceiling panels in a grid pattern) and there are hundreds of them... so just looking for a little automation as to what length of each trim type I need..

Posted
(vla-put-normal apr (vlax-3d-point 0.0 0.0 1.0))

 

I just noticed that you are selecting a region. That is the problem.

 

Documentation says that it has a Normal Property. Object browser shows the normal property of the region to be read only.

 

All three answers are NOT true

Posted
Normal is not my thing but just remembered this link :

 

 

http://www.cadtutor.net/forum/showthread.php?103507-MTEXT-normal-value.-Is-it-possible-to-change-this-to-0

 

 

maybe it helps ...

 

This is what I have for the most part. Works with circles, polygon and text from my testing.. but errors out with regions.

 

All three answers are NOT true

 

When I dump object on the region it does have an (RO) read-only label on the "Normal" property

Are you saying there's a way around this?

Posted

Possible solution:

Set the UCS to align to the region based on the current normal, make a block then (entmod) association 210... which is easy when it's something like (1 0 0).. but if it's rotated in an arbitrary angle not parallel or perpendicular to any axis it gets complicated.. I don't know how to decipher the numbers.

(command "UCS" "Object" reg) returns "This object does not define a coordinate system"... but when I select the region on the graphic screen it works (wouldn't work for the routine if they have to be selected graphically).

Posted

only thing I could dig up :

 

https://forums.autodesk.com/t5/visual-basic-customization/how-to-set-normal-of-a-region/td-p/1672775

 

2?xdesc=1.0

*Allen Johnson Archived Account

‎06-15-2006 07:13 AM

 

 

Re: how to set normal of a region

>A region (which, as you say, must be planar) can have any orientation and its "normal" will reflect that.

 

If a region is coplanar, and by definition (of a normal vector) it can only have one direction for its normal vector (perpendicular

to the plane). If you want to change its "normal" vector you have to (3d) rotate the region (in space). That's why the normal

property for a region is read-only.

Posted
only thing I could dig up :

 

https://forums.autodesk.com/t5/visual-basic-customization/how-to-set-normal-of-a-region/td-p/1672775

 

2?xdesc=1.0

*Allen Johnson Archived Account

‎06-15-2006 07:13 AM

 

 

Re: how to set normal of a region

>A region (which, as you say, must be planar) can have any orientation and its "normal" will reflect that.

 

If a region is coplanar, and by definition (of a normal vector) it can only have one direction for its normal vector (perpendicular

to the plane). If you want to change its "normal" vector you have to (3d) rotate the region (in space). That's why the normal

property for a region is read-only.

 

That's what it's looking like... That said how do i determine rotation of each axis based on the normal vector? haven't been able to figure it out by experimenting...

Posted

i think you'd have to get the objects matrix like nentselp gives but I have almost zero experience with that stuff and I'm sure those who do can give you a short one-liner for that but at this time I probably know precisely as much as you about this...

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...