Skip to content

Instantly share code, notes, and snippets.

View autokludge's full-sized avatar

Jesse Robertson autokludge

View GitHub Profile
@autokludge
autokludge / acute-chamfer.lsp
Last active November 11, 2022 04:35
Acute-Chamfer
; draws chamfer of given length between two edges
; adapted from Lee_Mac post at
;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-available-for-angle-between-two-lines/m-p/3241256/highlight/true#M300565
(defun c:oddcham ( / _SelectIf e1 e2 f in l1 l2 s1 s2 )
(defun _SelectIf ( msg pred )
(
(lambda ( f / e )
(while
(progn (setvar 'ERRNO 0) (setq e (car (entsel msg)))
@autokludge
autokludge / create_segments.vb
Created September 17, 2021 12:58
iLogic create segments example
Imports System
Sub main()
' @autokludge 2021
Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
Dim assembly_doc As AssemblyDocument = ThisDoc.Document
Dim assembly_component_def = assembly_doc.ComponentDefinition
Dim template_doc_name = "test-guggis-master.ipt"
@autokludge
autokludge / example.vb
Created August 25, 2021 08:28
set length user parameter (untested)
Sub Main
Dim asmDoc As AssemblyDocument = ThisApplication.ActiveDocument
'Iterate through all of the referenced documents
For Each doc As Document In asmDoc.AllReferencedDocuments
'update the components
If doc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
AddLengthParameter(doc)
End If
Next
@autokludge
autokludge / rectangleSize.lsp
Created June 12, 2020 00:15
AutoCAD label rectangle size
(defun c:LabelRec (/ ActDoc CurSpace Ht ss cnt Ent EntData VerPoints tmpEnt Wid Len Pt Str tmpText tmpDist1 tmpDist2)
; original version as posted didn't work
; originally found at https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-that-dimensions-a-rectangle/td-p/4556923
; Label rectangles with length and width in middle of them.
(vl-load-com)
(setq ActDoc (vla-get-ActiveDocument (vlax-get-Acad-Object)))
(if (= (getvar "cvport") 1)
(setq CurSpace (vla-get-PaperSpace ActDoc))
(setq CurSpace (vla-get-ModelSpace ActDoc))
)
@autokludge
autokludge / TEST Selection - DrawingCurve.iLogicVb
Created July 2, 2019 01:59
Inventor ilogic - test drawing line type
' Set a reference to the active document
Dim oDoc As Document = ThisDoc.Document
Dim oSelectSet As SelectSet = oDoc.SelectSet
'Are things selected?
If oSelectSet.Count < 1 Then
MsgBox("Select drawing line first", MsgBoxStyle.OkOnly, "Error")
Return
End If
@autokludge
autokludge / change_Detail_view_size.iLogicVb
Created January 22, 2019 01:19
Inventor iLogic change detail view radius (circle only)
Dim oDrawDoc As DrawingDocument = ThisDrawing.Document
Dim oSheet As Sheet
Dim oSheets As Sheets
'Dim oView As DrawingView
Dim oViews As DrawingViews
Dim oSizeStr As String
Dim oSize As Double
oSizeStr = InputBox("Enter Desired Size", "Size", "")
If Not IsNumeric(oSizeStr) Then
{
"sublimelinter": "load-save",
"sublimelinter_executable_map":
{
"php": "C:/php/php.exe",
"javascript" : "C:/Program Files/nodejs/node.exe",
"css" : "C:/Program Files/nodejs/node.exe"
},
"jshint_options":
@autokludge
autokludge / gist:4714990
Last active December 12, 2015 04:29
full width videos for youtube watch page (change height value for wider screens, 760 works well for 1280 wide screens)
// ==UserScript==
// @name Youtube Resize
// @namespace http://speilberg0.github.com
// @version 0.2
// @description make wide youtube full width
// @match http*://www.youtube.com/watch*
// @copyright 2012+, Speilberg0
// ==/UserScript==
st = document.createElement('style');
st.textContent = '#watch7-container.watch-medium #watch7-video-container {padding-left :0 !important;}\
{
"auto_complete": true,
"bold_folder_labels": true,
"close_windows_when_empty": false,
"color_scheme": "Packages/Dayle Rees Color Schemes/LastNight.tmTheme",
"default_line_ending": "unix",
"detect_indentation": false,
"detect_slow_plugins": false,
"disable_tab_abbreviations": true,
"draw_white_space": "all",
@autokludge
autokludge / Speilberg0-Tomorrow-Night.tmTheme
Created November 20, 2012 12:20
speilberg0-tomorrow-night sublime color scheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>comment</key>
<string>http://chriskempson.com</string>
<key>name</key>
<string>Tomorrow Night</string>
<key>settings</key>
<array>