Jump to content

Recommended Posts

eimimitu

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)

Share this post


Link to post
Share on other sites
Hippe013
(vla-put-normal apr (vlax-3d-point 0.0 0.0 1.0))

Share this post


Link to post
Share on other sites
eimimitu

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

Share this post


Link to post
Share on other sites
Hippe013

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

Share this post


Link to post
Share on other sites
eimimitu

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

Share this post


Link to post
Share on other sites
Hippe013

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

Share this post


Link to post
Share on other sites
eimimitu

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?

Share this post


Link to post
Share on other sites
Hippe013

What exactly are you trying to do?

Share this post


Link to post
Share on other sites
eimimitu

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

Share this post


Link to post
Share on other sites
eimimitu

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

Share this post


Link to post
Share on other sites
Hippe013

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.

Share this post


Link to post
Share on other sites
eimimitu

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

Share this post


Link to post
Share on other sites
poulhein
(vla-put-normal apr (vlax-3d-point '(0.0 0.0 1.0)))

Share this post


Link to post
Share on other sites
poulhein
(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

Share this post


Link to post
Share on other sites
eimimitu
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?

Share this post


Link to post
Share on other sites
eimimitu

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

Share this post


Link to post
Share on other sites
rlx

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.

Share this post


Link to post
Share on other sites
eimimitu
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...

Share this post


Link to post
Share on other sites
rlx

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×