Jump to content

Search the Community

Showing results for tags 'api'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions

Categories

  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 8 results

  1. Hello Using API, I can get a SketchBlockDefinition residing inside a drawing document. How can I get, using API, the name of this block that is displayed in the feature manager?
  2. Good day everyone, I am hoping to find some practitioners (Site Engineers, Construction Managers, Schedulers, Cost Estimators, BIM coordinators, Consultants, Designers with understanding of the on-site BIM implementation, etc.) working with Revit interested in answering a few questions about what kind of additional functionalities could improve Revit's applicability for Small and Medium Contracting Enterprises (SMCEs), i.e. for small residential projects. My thesis' aim is to create an add-on in Revit's Application Programming Interface (API) (C#) that could provide some value for those companies and make the Revit's users' lives easier. The tool is intended to be user-friendly and not introducing additional complexity to the works. Even though I have some ideas, a list of functions to implement in the add-on as well as general design have not yet been determined. I worked as a full-time structural designer for 1.5 years, yet I do not have a hands-on experience from the site. It is of crucial importance to me that my add-on will be applicable in real-life situations and that is why I decided to perform interviews with experienced practitioners and later also evaluate the functionality. I will probably do some of them offline, at Aarhus, Denmark, where I study but I also have a feeling that reaching out to a larger audience online could provide additional good results. So here are the questions - if you do not have an opinion or do not want to share then just avoid the particular question: What is your companies name and size (employee-wise)? What is your job position and what are your main responsibilities? For how long have you been using BIM technologies? What are you using BIM for in your work? What kind of software does your company use (BIM or non-BIM)? What is it used for? In your opinion, what are the main 3 reasons why some of the small and medium contracting companies do not use BIM? On what kind of projects did you find use of BIM the most beneficial and how did it benefit the project? Use of which Revit functions is the most beneficial for your projects? Does your company use add-ons for Revit? If yes - which ones and what are their pros and cons? If no – why not? What Revit functions you use are not sufficient / optimally working in your opinion? How could they be improved? What is Revit lacking that could enhance the user’s experience from your perspective? Do you use any kind of “home-made” supporting tools (add-ons, worksheets, macros, etc.) for your company related to contracting work that improve project’s efficiency? If yes what are they and what is their purpose? If no, would you consider using them? What to avoid when creating an add-on your company would use? Any additional suggestions for a Revit add-on designed for an SMCE? Questions 8 and 11 are of the highest importance for the research. Also please ask if something about any of the questions is unclear. I can revise them. Additionally, I would be happy to start a discussion on the subject. It is possible that I might want to cite answers from some of you in my report if you will give me the permission of course. Looking forward to your responses!
  3. roldy

    Move a spline using a macro

    I am needing to copy and move a spline in a sketch without using the spline's ID. Within the macro code, I have defined the selected spline in the sketch to a SketchSegment variable. Any help would be great.
  4. I want to run this code [font=Times New Roman][size=3] [/size][/font] [color=black][font="Courier New"]On Error Resume Next[/font][/color] [font=Times New Roman][size=3] [/size][/font] [color=black][font="Courier New"]Dim oDrawDoc As DrawingDocument[/font][/color] [font=Times New Roman][size=3] [/size][/font] [color=black][font="Courier New"]oDrawDoc = ThisApplication.ActiveDocument[/font][/color] [font=Times New Roman][size=3] [/size][/font] [color=black][font="Courier New"]Dim oPartsList As PartsList[/font][/color] [font=Times New Roman][size=3] [/size][/font] [color=black][font="Courier New"]oPartsList = oDrawDoc.ActiveSheet.PartsLists.Item(1)[/font][/color] [font=Times New Roman][size=3] [/size][/font] [color=black][font="Courier New"]If Not oPartsList Is Nothing Then [/font][/color] [font=Times New Roman][size=3] [/size][/font] [color=black][font="Courier New"]Call oPartsList.Sort("PART NUMBER")[/font][/color] [font=Times New Roman][size=3] [/size][/font] [color=black][font="Courier New"]oPartsList.Renumber[/font][/color] [font=Times New Roman][size=3] [/size][/font] [color=black][font="Courier New"]oPartsList.SaveItemOverridesToBOM[/font][/color] [font=Times New Roman][size=3] [/size][/font] [color=black][font=Calibri][size=3]End If[/size][/font][/color] [font=Times New Roman][size=3] [/size][/font] when it is write as a ilogic code it Works.. what I want to do is the want a bottum that do the same thing.. and the code make a error ... I am new to this ... can you help?
  5. hi to everyone, You will find attached a txt file which contains coordinate points from a naca that i created with qblade. I want someone to help me with creating a program at inventor's api that will read this txt and then transfers the content to an excel file. thank you in advance Blade.zip
  6. ILoveMadoka

    Solidworks Macros - 2 Part Question

    1) Are there any SW API Power Users Here? That could help modify macro code? 2) Are there any sites that anyone can recommend similar to CADTUTOR specific to solidworks (More specifically Macro programming/editing) I find a lot of blogs but not a lot of interactive type sites.. I know there are some experienced SW users here but I am trying to learn more about Macro creation/modification. Here is an example: I have multiple details in a SW drawing that each have "Detail X" on one line and "Scale 1:2" on the second line. I have to make the "Detail" text one size, the "X" another size and the "Scale 1:2" text a third size. (Not my idea! ) I recorded a macro highlighting each text portion and changing the text size but when I run the macro on a new piece of text, it changes the entire text item to each size in turn. These labels are identical so it seems easy enough but not sure if a macro can do something of this nature in a single step. Any help, links, etc is greatly appreciated!!
  7. Hello, I am fairly new to SolidWorks and even newer to scripting. Our design department recently came to me wondering if there was a way to create a macro that when they selected a part in the feature tree on the left hand side, and pushed the macro hotkey, if the name could be copied to the clipboard to be pasted in other programs. We have various documents that they need the name of, and right now they are right clicking on the part name and selecting properties, and getting to the name that way to copy it. It would be a lot easier for them if they could just do a quick key similar to ctrl+c to copy it. It would be even better if they could select multiple parts at a time, and have it copy each part name on a different line so when you pasted it, it would look similar to: part1 part2 part3 If anyone has anyone could help me out it would be very much appreciated. Even if all you can give me is pointers or suggestions. Thanks very much!!
  8. PATPOWER

    Solidworks api saveas problem

    Hi, I have a macro that copy all sheet from a drawing and open new template and paste the sheets on. Then close old drawing and saveas the new one with the same name of the original one to overwrite it. The problem is that I cannot save after the paste is done. It works for a while but not anymore and I change nothing. Do you have any ideas ? here my code..It works well with the part and assy section.. Thank you Dim vSheetName As Variant Dim swView As SldWorks.View Dim swDraw As SldWorks.DrawingDoc Dim swAnn As SldWorks.Annotation Dim swSelMgr As SldWorks.SelectionMgr Dim SWNOTE As SldWorks.NOTE Dim S As String Dim swCustPropMgr As SldWorks.CustomPropertyManager Dim SheetCount As Integer Dim DOC As ModelDoc2 Dim boolstatus As Boolean Dim longstatus As Long, longwarnings As Long Dim PART As Object Dim PARTTITLE As String Dim X As String Public Z As String Public Q As String Dim SWAPP As SldWorks.SldWorks Dim swModel As ModelDoc2 Dim nErrors As Long Sub main() Dim Answer As String Dim MyNote As String 'Place your text here MyNote = "DO YOU REALLY WISH TO REFRESH" & Chr(13) & "ACTUAL DOCUMENT AUTHOR AND DATE?" 'Display MessageBox Answer = MsgBox(MyNote, vbQuestion + vbYesNo, "???") If Answer = vbNo Then 'Code for No button Press MsgBox "OPERATION ABORT BY USER!" Exit Sub 'Code for Yes button Press End If Z = 0 A = 0 Set SWAPP = Application.SldWorks Set DOC = SWAPP.ACTIVEDOC If DOC Is Nothing Then MsgBox "A SOLIDWORKS DOCUMENT MUST BE OPEN" & Chr(13) & "TO PERFORM REFRESH THIS WAY!!": End Dim swDocTypeLong As Long Set PART = SWAPP.ACTIVEDOC EXT = Right(PART.GetPathName, 7) swDocTypeLong = Switch(EXT = ".SLDPRT", swDocPART, EXT = ".SLDDRW", swDocDRAWING, EXT = ".SLDASM", swDocASSEMBLY, True, -1) X = PART.GetPathName PARTTITLE = PART.GetTitle If swDocTypeLong = swDocDRAWING Then GoTo 2 UserForm3.Show If Z = 1 Then Exit Sub Set SWAPP = Application.SldWorks Set DOC = SWAPP.ACTIVEDOC 'boolstatus = swApp.CloseAllDocuments(True) 'Debug.Print boolstatus 'If swDocTypeLong = swDocPART Then GoTo 4 'If swDocTypeLong = swDocASSEMBLY Then GoTo 4 Set PART = SWAPP.ACTIVEDOC Set swModel = SWAPP.ACTIVEDOC Set swCustPropMgr = swModel.Extension.CustomPropertyManager("") swCustPropMgr.Add2 "DESIGN DATE", swCustomInfoText, " " swCustPropMgr.Set "DESIGN DATE", Q PART.DeleteAllRelations Dim swEquationMgr As Object Set swEquationMgr = PART.GetEquationMgr() swEquationMgr.add -1, Chr(34) & "Autorun""" & "=" & "Application.SldWorks.RunMacro" & "(" & """" & "C" & ":" & "\" & "SOLIDWORKS" & " " & "MACRO" & "\" & "MACRO4.swp" & """,""" & "MACRO41" & """,""main" & """)" swModel.SummaryInfo(SwConst.swSumInfoAuthor) = "PAT LAFONTAINE" GoTo 6 2 Set PART = SWAPP.ACTIVEDOC Set swModel = SWAPP.ACTIVEDOC Set SWDWG = swModel Set swDraw = swModel vSheetName = swDraw.GetSheetNames 'For i = 0 To UBound(vSheetName) SheetCount = PART.GetSheetCount SWDWG.ActivateSheet vSheetName(SheetCount - (SheetCount)) PARTTITLE = PART.GetTitle boolstatus = PART.Extension.SelectByID2(vSheetName(SheetCount - 1), "SHEET", 0, 0, 0, False, 0, Nothing, 0) If SheetCount - 1 = 0 Then GoTo 8 boolstatus = PART.Extension.SelectByID2(vSheetName(SheetCount - 2), "SHEET", 0, 0, 0, True, 0, Nothing, 0) If SheetCount - 2 = 0 Then GoTo 8 boolstatus = PART.Extension.SelectByID2(vSheetName(SheetCount - 3), "SHEET", 0, 0, 0, True, 0, Nothing, 0) If SheetCount - 3 = 0 Then GoTo 8 boolstatus = PART.Extension.SelectByID2(vSheetName(SheetCount - 4), "SHEET", 0, 0, 0, True, 0, Nothing, 0) If SheetCount - 4 = 0 Then GoTo 8 boolstatus = PART.Extension.SelectByID2(vSheetName(SheetCount - 5), "SHEET", 0, 0, 0, True, 0, Nothing, 0) If SheetCount - 5 = 0 Then GoTo 8 boolstatus = PART.Extension.SelectByID2(vSheetName(SheetCount - 6), "SHEET", 0, 0, 0, True, 0, Nothing, 0) If SheetCount - 6 = 0 Then GoTo 8 boolstatus = PART.Extension.SelectByID2(vSheetName(SheetCount - 7), "SHEET", 0, 0, 0, True, 0, Nothing, 0) If SheetCount - 7 = 0 Then GoTo 8 boolstatus = PART.Extension.SelectByID2(vSheetName(SheetCount - , "SHEET", 0, 0, 0, True, 0, Nothing, 0) If SheetCount - 8 = 0 Then GoTo 8 boolstatus = PART.Extension.SelectByID2(vSheetName(SheetCount - 9), "SHEET", 0, 0, 0, True, 0, Nothing, 0) If SheetCount - 9 = 0 Then GoTo 8 boolstatus = PART.Extension.SelectByID2(vSheetName(SheetCount - 10), "SHEET", 0, 0, 0, True, 0, Nothing, 0) If SheetCount - 10 > 0 Then MsgBox "DRAWING COUNTAIN MORE THAN 10 SHEETS," & Chr(13) & "ONLY 10 FIRST WILL BE COPY," & Chr(13) & "SO CHECK TO MANUALLY COPY MISSING SHEETS." 8 PART.EditCopy 'If Right(M, 6) = "SLDASM" Then Set PART = swApp.NewDocument("s:\aaatemplates\solidworks 2010 template\fond de plan\ASSY-D_Orientech.slddrt", 12, 0.2794, 0.4318) Set PART = SWAPP.NewDocument("s:\aaatemplates\solidworks 2010 template\DRAWING.drwdot", 12, 0.2794, 0.4318) SWAPP.ActivateDoc2 "Draw7 - Sheet1", False, longstatus 'Y = Mid(X, 1, Len(X) - 7) & "1" & Right(X, 7) 'PARTTITLE2 = PART.GetTitle 'SWAPP.CloseDoc PARTTITLE 'Set PART = SWAPP.ActivateDoc2(PARTTITLE2, 0, 0) 'longstatus = PART.SaveAs3(Y, 0, 0) 'PARTTITLE3 = PART.GetTitle 'SWAPP.CloseDoc PARTTITLE3 'Set swModel = SWAPP.OpenDoc6(Y, swDocTypeLong, swOpenDocOptions_Silent, "", nErrors, NWARNINGS) Set PART = SWAPP.ACTIVEDOC Dim myDrawingSheet As Object Set myDrawingSheet = PART.GetCurrentSheet() myDrawingSheet.SetName "SHEET TO DELETE" Set PART = SWAPP.ACTIVEDOC boolstatus = PART.Extension.SelectByID2("SHEET TO DELETE", "SHEET", 0, 0, 0, False, 0, Nothing, 0) PART.Paste Set swModel = SWAPP.ACTIVEDOC Set SWDWG = swModel Set swDraw = swModel vSheetName = swDraw.GetSheetNames SWDWG.ActivateSheet vSheetName(SheetCount - (SheetCount - 1)) Set swModel = SWAPP.ACTIVEDOC Set swDraw = swModel Set swSheet = swDraw.GetCurrentSheet Set swSelMgr = swModel.SelectionManager Set swView = swDraw.GetFirstView Set swView = swView.GetNextView Set swModel = SWAPP.ACTIVEDOC Set SWDWG = swModel SWDWG.ActivateSheet "SHEET TO DELETE" M = swView.ReferencedDocument.GetPathName Set PART = SWAPP.ACTIVEDOC Dim MYView As Object Set MYiew = PART.CreateDrawViewFromModelView3(M, "*Front", 0.1097457655955, 0.1648856124764, 0) Set swModel = SWAPP.ACTIVEDOC Set SWDWG = swModel sSheetNames = SWDWG.GetSheetCount Set swSelMgr = swModel.SelectionManager Set swModel = SWAPP.ACTIVEDOC Set PART = SWAPP.ACTIVEDOC boolstatus = PART.Extension.SelectByID2("DetailItem346@Sheet Format1", "NOTE", 0.4080223743143, -0.001548983140407, 0, False, 0, Nothing, 0) Set SWNOTE = swSelMgr.GetSelectedObject6(1, 0) Set swAnn = SWNOTE.GetAnnotation S = SWNOTE.GetText SWDWG.ActivateSheet vSheetName(SheetCount - (SheetCount - 1)) Set myDrawingSheet = PART.GetCurrentSheet() Set swDraw = swModel Set swSheet = swDraw.GetCurrentSheet myDrawingSheet.SetName "Sheet1" boolstatus = PART.Extension.SelectByID2("SET AUTHOR NAME & PROPERTY1", "SHEET", 0, 0, 0, False, 0, Nothing, 0) 'part.DeleteSelection (False) If boolstatus = True Then GoTo 9 boolstatus = SWAPP.RunMacro2("c:\SOLIDWORKS MACRO\DWG.swp", "MACROFEATURE_MODULE1", "main", swRunMacroUnloadAfterRun, nErrors) 9 vSheetProps = swSheet.GetProperties 'Set swCustPropMgr = swModel.Extension.CustomPropertyManager("") 'swCustPropMgr.Add2 "DOCTYPE", swCustomInfoText, " " 'swCustPropMgr.Set "DOCTYPE", "$PRPSHEET" & ":" & Chr(34) & "DOCTYPE""" 'Set part = swApp.ACTIVEDOC 'S = swCustPropMgr.Get("DOCTYPE") If S = " " Then boolstatus = PART.SetupSheet5("Sheet1", 12, 12, vSheetProps(2), vSheetProps(3), False, "PART-B_Orientech.slddrt", 0.4318, 0.2794, "Default", True) If S = " " Then boolstatus = PART.SetupSheet5("Sheet1", 12, 12, vSheetProps(2), vSheetProps(3), False, "ASSY-D_Orientech.slddrt", 0.4318, 0.2794, "Default", True) If S = "" Then boolstatus = PART.SetupSheet5("Sheet1", 12, 12, vSheetProps(2), vSheetProps(3), False, "ASSY-D_Orientech.slddrt", 0.4318, 0.2794, "Default", True) If S = "" Then boolstatus = PART.SetupSheet5("Sheet1", 12, 12, vSheetProps(2), vSheetProps(3), False, "PART-B_Orientech.slddrt", 0.4318, 0.2794, "Default", True) D = 2 3 If sSheetNames = D Then GoTo 5 SWDWG.ActivateSheet vSheetName(SheetCount - (SheetCount - D)) Set PART = SWAPP.ACTIVEDOC Set myDrawingSheet = PART.GetCurrentSheet() Set swDraw = swModel Set swSheet = swDraw.GetCurrentSheet vSheetProps = swSheet.GetProperties If A = 1 Then If S = " " Then boolstatus = PART.SetupSheet5("Sheet" & D - 1, 12, 12, vSheetProps(2), vSheetProps(3), False, "PART-B_Orientech.slddrt", 0.4318, 0.2794, "Default", True) If A = 1 Then If S = " " Then boolstatus = PART.SetupSheet5("Sheet" & D - 1, 12, 12, vSheetProps(2), vSheetProps(3), False, "ASSY-D_Orientech.slddrt", 0.4318, 0.2794, "Default", True) If A = 0 Then If S = " " Then boolstatus = PART.SetupSheet5("Sheet" & D, 12, 12, vSheetProps(2), vSheetProps(3), False, "PART-B_Orientech.slddrt", 0.4318, 0.2794, "Default", True) If A = 0 Then If S = " " Then boolstatus = PART.SetupSheet5("Sheet" & D, 12, 12, vSheetProps(2), vSheetProps(3), False, "ASSY-D_Orientech.slddrt", 0.4318, 0.2794, "Default", True) If A = 1 Then If S = "" Then boolstatus = PART.SetupSheet5("Sheet" & D - 1, 12, 12, vSheetProps(2), vSheetProps(3), False, "ASSY-D_Orientech.slddrt", 0.4318, 0.2794, "Default", True) If A = 1 Then If S = "" Then boolstatus = PART.SetupSheet5("Sheet" & D - 1, 12, 12, vSheetProps(2), vSheetProps(3), False, "PART-B_Orientech.slddrt", 0.4318, 0.2794, "Default", True) If A = 0 Then If S = "" Then boolstatus = PART.SetupSheet5("Sheet" & D, 12, 12, vSheetProps(2), vSheetProps(3), False, "ASSY-D_Orientech.slddrt", 0.4318, 0.2794, "Default", True) If A = 0 Then If S = "" Then boolstatus = PART.SetupSheet5("Sheet" & D, 12, 12, vSheetProps(2), vSheetProps(3), False, "PART-B_Orientech.slddrt", 0.4318, 0.2794, "Default", True) If A = 1 Then A = 0 'myDrawingSheet.SetName "Sheet" & D Dim bRet As Boolean Set SWAPP = CreateObject("SldWorks.Application") Set swModel = SWAPP.ACTIVEDOC Set swDraw = swModel Set swSheet = swDraw.GetCurrentSheet Set swView = swDraw.GetFirstView Debug.Print "File = " & swModel.GetPathName Debug.Print " " & swSheet.GetName While Not swView Is Nothing Debug.Print " " & swView.GetName2 & " [" & swView.Type & "]" Set swView = swView.GetNextView While swView Is Nothing boolstatus = PART.Extension.SelectByID2("Sheet" & D, "SHEET", 0, 0, 0, False, 0, Nothing, 0) PART.DeleteSelection (False) A = 1 GoTo 4 Wend GoTo 4 Wend 4 D = D + 1 GoTo 3 5 'swDwg.ActivateSheet "SHEET TO DELETE" boolstatus = PART.Extension.SelectByID2("SHEET TO DELETE", "SHEET", 0, 0, 0, False, 0, Nothing, 0) PART.DeleteSelection (False) 'part.EditDelete swModel.SummaryInfo(SwConst.swSumInfoAuthor) = "PAT LAFONTAINE" PARTTITLE2 = PART.GetTitle SWAPP.CloseDoc PARTTITLE Set PART = SWAPP.ActivateDoc2(PARTTITLE2, 0, 0) 'PART.Save2 (silent) Set PART = SWAPP.ACTIVEDOC 'Dim i As Integer ' Set SWAPP = Application.SldWorks ' SendKeys "%{F}" 'invoke file menu ' For i = 0 To 3 'go down to the saveas dialog ' SendKeys "{down}" ' Next i 'SendKeys "{enter}" 'enter longstatus = PART.SaveAs3(X, 0, 0) If swDocTypeLong = swDocDRAWING Then GoTo 11 6 longstatus = PART.SaveAs3(X, 0, 0) Set PART = Nothing Dim Answer3 As String Dim MyNote3 As String 'Place your text here MyNote3 = "DO YOU WISH TO CLOSE DOCUMENT?" 'Display MessageBox Answer3 = MsgBox(MyNote3, vbQuestion + vbYesNo, "???") If Answer3 = vbNo Then 'Code for No button Press GoTo 10 'Code for Yes button Press End If SWAPP.CloseDoc PARTTITLE GoTo 10 11 Set PART = SWAPP.ACTIVEDOC PARTTITLE = PART.GetTitle Set PART = Nothing Dim Answer2 As String Dim MyNote2 As String 'Place your text here MyNote2 = "DO YOU WISH TO CLOSE DOCUMENT?" 'Display MessageBox Answer2 = MsgBox(MyNote2, vbQuestion + vbYesNo, "???") If Answer2 = vbNo Then 'Code for No button Press GoTo 10 'Code for Yes button Press End If SWAPP.CloseDoc PARTTITLE 10 MsgBox "REFRESH DONE!" ' Define title. End End Sub
×
×
  • Create New...