eimimitu Posted April 16, 2018 Posted April 16, 2018 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) Quote
Hippe013 Posted April 16, 2018 Posted April 16, 2018 (vla-put-normal apr (vlax-3d-point 0.0 0.0 1.0)) Quote
eimimitu Posted April 16, 2018 Author Posted April 16, 2018 Unfortunately not the issue... same error... Quote
Hippe013 Posted April 16, 2018 Posted April 16, 2018 I just noticed that you are selecting a region. That is the problem. Quote
eimimitu Posted April 16, 2018 Author Posted April 16, 2018 oh!... What's wrong with regions... Documentation says they're valid entities for normal property. Quote
Hippe013 Posted April 16, 2018 Posted April 16, 2018 Documentation says that it has a Normal Property. Object browser shows the normal property of the region to be read only. Quote
eimimitu Posted April 16, 2018 Author Posted April 16, 2018 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? Quote
eimimitu Posted April 16, 2018 Author Posted April 16, 2018 extract the original profile from a 3DSOLID extrusion to be exact... to use as a graphic on a count table. Quote
eimimitu Posted April 16, 2018 Author Posted April 16, 2018 it's kinda like a bill of materials of a certain trim shape but i need to indicate the shape somehow Quote
Hippe013 Posted April 16, 2018 Posted April 16, 2018 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. Quote
eimimitu Posted April 17, 2018 Author Posted April 17, 2018 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.. Quote
poulhein Posted April 17, 2018 Posted April 17, 2018 (vla-put-normal apr (vlax-3d-point '(0.0 0.0 1.0))) Quote
rlx Posted April 17, 2018 Posted April 17, 2018 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 ... Quote
poulhein Posted April 17, 2018 Posted April 17, 2018 (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 Quote
eimimitu Posted April 17, 2018 Author Posted April 17, 2018 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? Quote
eimimitu Posted April 17, 2018 Author Posted April 17, 2018 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). Quote
rlx Posted April 17, 2018 Posted April 17, 2018 only thing I could dig up : https://forums.autodesk.com/t5/visual-basic-customization/how-to-set-normal-of-a-region/td-p/1672775 *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. Quote
eimimitu Posted April 17, 2018 Author Posted April 17, 2018 only thing I could dig up : https://forums.autodesk.com/t5/visual-basic-customization/how-to-set-normal-of-a-region/td-p/1672775 *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... Quote
rlx Posted April 17, 2018 Posted April 17, 2018 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... Quote
Recommended Posts
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.