Jump to content

vla-put-Normal


eimimitu

Recommended Posts

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)

Link to comment
Share on other sites

  • Replies 24
  • Created
  • Last Reply

Top Posters In This Topic

  • eimimitu

    12

  • Hippe013

    5

  • rlx

    4

  • poulhein

    2

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

(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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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