TheSwamp

Code Red => VB(A) => Topic started by: sbattina on April 05, 2004, 10:37:12 PM

Title: coordinates of 3dface
Post by: sbattina on April 05, 2004, 10:37:12 PM
Can anyone tell me why this code does not work. Infact I tried VarType(Vpoints) . It returns a '0' value....which I presume is Uninitialized values. I also tried assigning ObjEnt to another variable as a 3dface. both ways, It does not give an error...error but its does not give me the region.
Where am I wrong?


For Each objEnt In ThisDrawing.ModelSpace
If TypeOf objEnt Is Acad3DFace Then
objEnt.color = acCyan
 objEnt.Layer = "ABC"
Set Vpoints = objEnt.Coordinates
Set region = ThisDrawing.ModelSpace.AddRegion(Vpoints)
region.color = acBlue
End If
Next objEnt
Title: coordinates of 3dface
Post by: Keith™ on April 06, 2004, 01:41:26 PM
Are the points of the 3dface coplanar. If not then you will not be able to produce a region with them.
Title: coordinates of 3dface
Post by: sbattina on April 06, 2004, 03:22:52 PM
Quote

RetVal = object.AddRegion(ObjectList)
ObjectList - Array of Objects
The array of objects forming the closed coplanar face to be made into a region. This array may contain the following object types: Line, Arc, Circle, Elliptical Arc, LightweightPolyline, Spline.


I found out last night about region. Doesnt take points :roll: .
But have no idea why I dont get .coordinates.
hmmm..yes they are coplanar.
Title: coordinates of 3dface
Post by: sbattina on April 06, 2004, 03:55:11 PM
Quote
Set Vpoints = objEnt.Coordinates


I also used "set".......shouldnt have!!

lemme try it all again
Title: coordinates of 3dface
Post by: Keith™ on April 06, 2004, 03:55:44 PM
I should have realized that as well...

A quick check will reveal there is no "coordinates" property of a region, probably because a region can have multiple shaped segments, such as arcs, circles, splines and ellipses.

If you need to get the coordinates, you could explode the region, extract the coordinates of the resultant explode, then region the entities again.
Title: coordinates of 3dface
Post by: sbattina on April 06, 2004, 04:23:44 PM
I am trying to find the coordinates of  3dfaces in a selection set. I thought it would be simple enough with the ".coordinates" property.

It wasnt giving an error... I was using a on error resume next earlier in the subroutine.........another silly thing to do I guess.

autocad That I have at home does not have a developers help.....is there any online??
Title: coordinates of 3dface
Post by: Keith™ on April 06, 2004, 04:43:15 PM
I have a VBA resource I will share...let me know..
Title: coordinates of 3dface
Post by: sbattina on April 06, 2004, 06:44:27 PM
where is it Keith??.........
Title: coordinates of 3dface
Post by: Keith™ on April 06, 2004, 07:16:06 PM
It is too big to email, if you PM me your email address I will send you a link where you can download it along with some resources.