puffeltje Posted November 11, 2010 Share Posted November 11, 2010 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? Quote Link to comment Share on other sites More sharing options...
puffeltje Posted November 18, 2010 Author Share Posted November 18, 2010 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? Quote Link to comment Share on other sites More sharing options...
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.