Author Topic: Clip Boundaries for a Raster  (Read 38929 times)

0 Members and 1 Guest are viewing this topic.

ML

  • Guest
Re: Clip Boundaries for a Raster
« Reply #75 on: November 15, 2007, 07:10:13 PM »

Actually
I opened ACAD  LOL

I think (not sure) it has something to do with the getreal method but I am not sure.

I tried Declaring the variable as Integer then I realized that is only good if where want a whole number.

Then I tried as Variant and it works sometimes but not others.

So, I'm sure we will get it

Mark

Bob Wahr

  • Guest
Re: Clip Boundaries for a Raster
« Reply #76 on: November 15, 2007, 07:21:54 PM »
The opening acad wasn't a knock on you.  I'm working in Revit at the moment so I've just been guessing.  I'm 98% sure that getreal returns a double.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Clip Boundaries for a Raster
« Reply #77 on: November 16, 2007, 09:31:12 AM »
yes
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Clip Boundaries for a Raster
« Reply #78 on: November 16, 2007, 09:33:31 AM »
GetInteger gets an Integer whilst GetReal gets a Double
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Clip Boundaries for a Raster
« Reply #79 on: November 16, 2007, 09:36:17 AM »
Quote
Then I tried as Variant and it works sometimes but not others.
I think it might be here
Code: [Select]
  Dim Bndsize As Integer
  Bndsize = ThisDrawing.Utility.GetReal("What size boundary would you like?: ")
You are declaring an Integer, but asking for a Double

I would change it to Dim BndSize as Double
« Last Edit: November 16, 2007, 09:37:35 AM by CmdrDuh »
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

ML

  • Guest
Re: Clip Boundaries for a Raster
« Reply #80 on: November 16, 2007, 11:12:56 AM »

Hey Bob
It wasn't taken as such  :-)
I thought you were on your way home but still curious.

I know I have closed down, went to the men's room, got all my stuff together and said, hummmm, let me turn CAD on real quick; then 2 hours went by. So, once I shutdown; I really do try to "shutdown"  :-)
Revit huh? That sounds really cool! So you do 3D Modeling then?

CM, thank you for that little tip, I will use getreal and try using Double as my data type.
Do you think that is what is causing this method
Code: [Select]
  clipPoints(0) = mdpnt(0) - (Bndsize / 2): clipPoints(1) = mdpnt(1) - (Bndsize / 2)
  clipPoints(2) = mdpnt(0) - (Bndsize / 2): clipPoints(3) = mdpnt(1) + (Bndsize / 2)
  clipPoints(4) = mdpnt(0) + (Bndsize / 2): clipPoints(5) = mdpnt(1) + (Bndsize / 2)
  clipPoints(6) = mdpnt(0) + (Bndsize / 2): clipPoints(7) = mdpnt(1) - (Bndsize / 2)
  clipPoints(8) = mdpnt(0) - (Bndsize / 2): clipPoints(9) = mdpnt(1) + -(Bndsize / 2)
To work sometimes and not others?
Have you tried this method yet?

Mark

ML

  • Guest
Re: Clip Boundaries for a Raster
« Reply #81 on: November 16, 2007, 11:20:50 AM »

Yes sir (CM) my friend,
You nailed it! It seems to be wroking perfect now
We want Bndsize as Double

Code: [Select]
Dim Bndsize As Double
Bndsize = ThisDrawing.Utility.GetReal("What size boundary would you like?: ")

Bob, that method was a really cool idea!

Mark

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Clip Boundaries for a Raster
« Reply #82 on: November 16, 2007, 11:25:48 AM »
To work sometimes and not others?
Mark
Yes, but you know that b/c you just posted faster than me.  By having it as integer you had a 50% chance it would round off to the correct number, and 50% it didn't.  By using Double, you are getting the correct number and processing it from there
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

ML

  • Guest
Re: Clip Boundaries for a Raster
« Reply #83 on: November 16, 2007, 11:31:23 AM »

Yep

Very cool indeed!

So, you guys rastered out or what?

Mark

Bob Wahr

  • Guest
Re: Clip Boundaries for a Raster
« Reply #84 on: November 16, 2007, 11:36:53 AM »
trying to get more work done today.  Where are you at now in terms of things working/not working?

ML

  • Guest
Re: Clip Boundaries for a Raster
« Reply #85 on: November 16, 2007, 01:58:22 PM »

Bob! You mean you don't work for us? LOL  J/K
Everything as far as I can see is working A OK.
Very nice indeed.

I am really impressed by the dynamic boundary creations.

This discussion has really helped me learn more about getting, using and manipulating points.
And creating boundaries of course.

Now, I am thinking about putting the raster into a selection set in case I need to do something with after the user exits the sub or whatever.

After that, I think I will leave good enough alone.

Mark

ML

  • Guest
Re: Clip Boundaries for a Raster
« Reply #86 on: November 16, 2007, 03:56:53 PM »

Hey guys,

Let me throw this out there.

I noticed if I pick 2 points on the raster and the slection is less then 5' x 5' then only an image frame will display.

I know, "NO S**T, right?

Well, I am not sure that the user would understand why this is happening; so I am wondering if we can do something that will say, if picked boundary is less then 5' x 5' or in Bob's other code where the user types in the boundary size, can we catch that error?

I don't think we can say:
Select Case ClipPoints
 etc. etc.
End Select

However I could be wrong

THanks

Mark

Thanks
Mark

ML

  • Guest
Re: Clip Boundaries for a Raster
« Reply #87 on: November 19, 2007, 01:13:35 PM »

I am going to attempt to answer my own question here:

"After" or "when" the raster is inserted; I believe we can get the height and width of the raster.
After we have that, we can write some code that will say: If the boundary is > then the height and width of the inserted raster, then
Handle Error


ML

  • Guest
Re: Clip Boundaries for a Raster
« Reply #88 on: November 19, 2007, 01:16:00 PM »

ACtually, I noticed an error is not returned, you are just left with an imageframe with none of the image showing, so we would probably need to return a message to the user:

Msgbox " The specified boundary is too large etc. etc."

Mark

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Clip Boundaries for a Raster
« Reply #89 on: November 19, 2007, 01:42:08 PM »
I would say post the image you are working with so we can all play along
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)