1. Macro help
2. macro - help
Hi, I was wandering If anyone can create macro, which will change color from AC to MS? e.g. I have file from AC with default color table. When I save file as *.dgn I must used color.tbl from MS. After I have one file from AC which was converted to MS but all colours are different. Who can create macro or knows easy way to create new color table for AC? Please let me know asap :-) Zuza
3. Macro Help
I've got a macro question, I'm trying to make a macro that creates a
new drawing file from an assembly file, I am then wanting it to
generate various views placed in the same place. The last couple of
lines are the problem, this macro places views of a certain file but if
I open up a different assembly and make a drawing it places the views
from the first assembly. Any help would be greatly appreciated. I
know very little about Visual Basic, I'm currently taking a class in it
but I haven't learned much yet. I'm looking for the command to use
that selects the currently opened file name and puts it as a variable
to use in the drawing view creation. Also is there any way to make a
macro to do the selected dimension. For example a macro to change a
dimension that is selected to mm from inches?
'
******************************************************************************
' D:\DOCUME~1\LUCASL~1\LOCALS~1\Temp\swx4356\Macro1.swb - macro
recorded on 05/28/06 by *********************
'
******************************************************************************
Dim swApp As Object
Dim Part As Object
Dim SelMgr As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim Feature As Object
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
swApp.ActiveDoc.ActiveView.FrameLeft = 0
swApp.ActiveDoc.ActiveView.FrameTop = 0
swApp.ActiveDoc.ActiveView.FrameState = 1
Set Part = swApp.NewDocument("Drawing Template File Path", 12, 0.2794,
0.4318)
Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
Part.ViewZoomtofit2
boolstatus = Part.ActivateView("Drawing View1")
boolstatus = Part.Extension.SelectByID2("Drawing View1", "DRAWINGVIEW",
0.1173527476636, 0.1787637757009, 0, False, 0, Nothing, 0)
Part.EditDelete
Dim DrawView As Object
Set DrawView = Part.CreateDrawViewFromModelView2("Assembly File Path",
"*Isometric", 0.1297821308411, 0.1627831401869, 0)
boolstatus = Part.ActivateView("Drawing View4")
Set DrawView = Part.CreateDrawViewFromModelView2("Assebly File Path",
"*Front", 0.294915364486, 0.1610075140187, 0)
Part.ClearSelection2 True
End Sub
Lucas Laverman
Senior, Mechanical Engineering
6. Select chain and convert macro help
If you play the macro you will notice that it only selects the one segment.
I couldn't find an API to do this you may have to get all the segments and
compare endpoints to do this a bit more intensive.
Corey
"Eric T." < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
> Can someone show me how to change the API call to reflect a more
> generic macro?
> What I need is a simple macro to select chain ref. sketch geom. under
> the mouse and convert it entities. when I run the macro recorder I
> get:
>
> Dim swApp As Object
> Dim Part As Object
> Dim boolstatus As Boolean
> Dim longstatus As Long, longwarnings As Long
> Dim FeatureData As Object
> Dim Feature As Object
> Dim Component As Object
> Sub main()
>
> Set swApp = Application.SldWorks
>
> Set Part = swApp.ActiveDoc
> boolstatus = Part.Extension.SelectByID2("Line31@Sketch7",
> "EXTSKETCHSEGMENT", 0.02657237821555, -0.04846803192663, 0, False, 0,
> Nothing)
> boolstatus = Part.SketchUseEdge2(False)
> Part.ClearSelection2 True
> End Sub
>
>
> Not sure how to clean this up and just work with what under the mouse.
> Any help would be great.
>
> Eric
7. API: Select chain and convert macro help
I've used the macro feature a couple of times before but never got into programming with code. I have created a macro that rotates the part to an isometric view, zooms it to fit the screen and saves it to a specific location. ' **************************************************************************** ** ' C:\DOCUME~1\lucas\LOCALS~1\Temp\swx1772\Macro1.swb - macro recorded on 08/26/05 by lucas ' **************************************************************************** ** Dim swApp As Object Dim Part As Object Dim boolstatus As Boolean Dim longstatus As Long, longwarnings As Long Dim FeatureData As Object Dim Feature As Object Dim Component As Object Sub main() Set swApp = Application.SldWorks Set Part = swApp.ActiveDoc Part.ShowNamedView2 "*Isometric", 7 Part.ViewZoomtofit2 Part.SaveAs2 "E:\Lucas\Seradex Items\Part Pictures\11115.JPG", 0, True, False End Sub As you can see, the part is always saved under the name "11115.JPG". I would like to change it so that the file name minus the ".SLDPRT" is used. Can anyone help me out? Thanks