Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

get polyline height vba

10 REPLIES 10
Reply
Message 1 of 11
imagination_s
549 Views, 10 Replies

get polyline height vba

Hellow Everyone,

Can somebody help me with geting polyline height  in autocad 2008  vba macro

Please help.

the picture below show what i want

Thankyou for your help.

Aprecciated

10 REPLIES 10
Message 2 of 11
hgasty1001
in reply to: imagination_s

Hi,

 

The polyline height will be := |Max(Ycoordinates) - Min(Ycoordinates)|, do you have some trouble obtaining the coordinates of the polyline?

 

Gaston Nunez

 

Message 3 of 11
paullimapa
in reply to: imagination_s
Message 4 of 11
imagination_s
in reply to: hgasty1001

Can you pleasse show me an example of how to use your code for MaxY and Min Y?

Thankyou .Aprecciated your help

Message 5 of 11
hgasty1001
in reply to: imagination_s

Hi,

 

Do you know how to program? find the max or min of an array it's a very, very basic algorithm:

 

1.-Take the first value of the array, asign  a variable max to this value

2.-Iterate the array, and compare max against each antry

3.- If that entry it's greater than max, update max to this value

4.-At the end max has the max value of the array

 

For min, change "grater than" for "less than"

 

An alternative it's to program a sort over the array, so at the end of the sorting process you will have the max and the min of the array.

 

Gaston Nunez

 

 

 

Message 6 of 11
imagination_s
in reply to: hgasty1001

Thenkyou for your help.

I will try to make a function from  your suggestions

Best Regards

Message 7 of 11
dbroad
in reply to: imagination_s

This is a code fragment (untested) that might point to an alternative solution.

 

Dim obj As AcadObject 'any object
Dim llc As AcadPoint 'lower left corner
Dim urc As AcadPoint 'upper right corner
Dim h As Double 'height

'...code to select an object including polylines..not shown
obj.GetBoundingBox llc, urc
h = urc(0, 1) - llc(0, 1)

 

Architect, Registered NC, VA, SC, & GA.
Message 8 of 11
imagination_s
in reply to: dbroad

Thankyou soo much for all your help
I will use your code.
Best Regards
Message 9 of 11
imagination_s
in reply to: dbroad

Hellow Dbroad,

Is there a way to select only a polyline and get boundary of it ,without select the  points

 

Thankyou so much

Message 10 of 11
dbroad
in reply to: imagination_s

What do you mean by "get a boundary of it"?

 

If you do not know how to select objects using vba, then you should post this question on the vba newsgroup where you can get more assistance.  If you are willing to accept LISP solutions, then let us know.

Architect, Registered NC, VA, SC, & GA.
Message 11 of 11
imagination_s
in reply to: dbroad

I reffer to autocad vba so YEs a need to ask the question to vba customization

Thankyou for your help

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost