Jump to content

Explode block with polyline


puffeltje

Recommended Posts

Hi,

 

When i use the following code in VBA i can place a block and it explode as i expect.

 
p1 = ThisDrawing.Utility.GetPoint(, NL & "Geef invoerpunt: ")
Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(p1, PicPath & symbool & ".dwg", 1#, 1#, 1#, 0)
'explodeer het geplaatste symbool zodat elk onderdeel te muteren is.
'de opdracht "blockRefObj.Explode" blijkt niet te werken. Opgelost met onderstaande regel
ThisDrawing.SendCommand ("explode" & vbCr & "(handent " & Chr(34) & blockRefObj.Handle & Chr(34) & ")" & vbCr & vbCr)

 

 

But when i use the following code to place and stretch the same block all the polylines in the block are changing to lines:

 
p1 = ThisDrawing.Utility.GetPoint(, NL & "Geef 1e invoerpunt: ")
p2 = ThisDrawing.Utility.GetPoint(, NL & "Geef 2e invoerpunt: ")
'horizontale kabel, dus delta-X wordt de lengte
lengte = (p2(0) - p1(0)) / 10
Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(p1, PicPath & symbool & ".dwg", lengte, 1#, 1#, 0)
ThisDrawing.SendCommand ("explode" & vbCr & "(handent " & Chr(34) & blockRefObj.Handle & Chr(34) & ")" & vbCr & vbCr)

 

 

Am i doing something wrong?

Link to comment
Share on other sites

When i look at INSERT-BLOCK i can't input different values for the scale x, y and z when i checked EXPLODE.

 

Because my symbol is a very simpel symbol (only some lines and polylines). I wrote a piece of code to generate these lines in the drawing. The lines are drawing as i wanted; the polylines are drawing with the right width. So far, so good.

The only thing is that i didn't get the color right of the polyline. I place the polyline with the code:

 
Set lijndik = ThisDrawing.ModelSpace.AddLightWeightPolyline(pointpoly())
lijndik.SetWidth 0, 1, 1

How can i change the color to red?

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